ZIO<R, E, A>.lazy constructor

ZIO<R, E, A>.lazy(
  1. ZIO<R, E, A> zio()
)

Create a ZIO lazily with the given function. Useful for when you need to create a ZIO from a synchronous side-effect.

Implementation

factory ZIO.lazy(ZIO<R, E, A> Function() zio) =>
    ZIO.from((ctx) => zio().unsafeRun(ctx));