package async_kernel
Module Laziness_preserving_deferred
Laziness_preserving_deferred offers a monad for working with lazy deferreds that has similar semantics to the Deferred monad. In the regular Lazy_deferred monad, each map/bind introduces a new lazy computation, and nothing runs unless explicitly forced. By contrast, this monad lets you build up a tree of computations that can be "weakly run," meaning that it will run until it encounters an unforced lazy deferred, at which point it will wait for that lazy deferred to be forced before continuing.
include Core.Monad.S with type 'a t := 'a t
module Monad_infix : sig ... endval return : 'a -> 'a tmodule Let_syntax : sig ... endval of_eager : 'a Async_kernel.Deferred.t -> 'a tval of_lazy : 'a Async_kernel.Lazy_deferred.t -> 'a tval force : 'a t -> 'a Async_kernel.Deferred.Or_error.tBegin computing 'a t, forcing lazy deferreds as they are encountered.
val weak_run : 'a t -> 'a Async_kernel.Deferred.Or_error.tBegin computing 'a t, waiting on lazy deferreds as they are encountered.