Download Latest Version 2.1.20 source code.tar.gz (58.6 MB)
Email in envelope

Get an email when there's a new version of ZIO

Home / v2.1.16
Name Modified Size InfoDownloads / Week
Parent folder
2.1.16 source code.tar.gz 2025-02-26 57.2 MB
2.1.16 source code.zip 2025-02-26 58.1 MB
README.md 2025-02-26 9.4 kB
Totals: 3 Items   115.2 MB 0

Highlights

This seemingly small release brings 2 new features to ZIO which library authors can utilize in order to provide a better DX for users. As usually, it also contains a number of optimizations, bug fixes, and it's fully binary and source-compatible with the rest of the v2.x series.

HasNoScope evidence (https://github.com/zio/zio/pull/9604)

In ZIO, having a Scope as an environment requirement indicates that the effect contains finalizers (e.g., closing an HTTP connection) which need to be handled at some point in the evaluation of the effect or the application's lifetime. In certain cases, we might want to ensure that an effect provided to a method does not contain any finalizers. Starting with this version of ZIO, users / library authors can use the HasNoScope evidence for methods where the environment is generic, e.g.,:

:::scala
def foo[R, A](f: ZIO[R, Nothing, A)(using HasNoScope[R]) = ???

val f1 = foo(ZIO.succeed("foo")) // compiles
val f2 = foo(ZIO.acquireRelease(ZIO.succeed("foo"))(_ => ZIO.unit)) // fails to compile

Note that this feature is primarily intended for use in libraries such as zio-http where we need to ensure that a user-provided effect does not contain any finalizers.

Generic interfaces for non-empty collections (https://github.com/zio/zio/pull/9560)

This release introduces the NonEmptySeq type class (which NonEmptyChunk now extends) so that users / library authors can write generic code which requires non-empty collections as arguments.

What's Changed

Other changes (CI, dependencies and documentation)

Full Changelog: https://github.com/zio/zio/compare/v2.1.15...v2.1.16

Source: README.md, updated 2025-02-26