MonadDefer
public protocol MonadDefer : MonadError
MonadDefer is a Monad
that provides the ability to delay the evaluation of a computation.
-
Provides a computation that evaluates the provided function on every run.
Parameters
fa
Function returning a computation to be deferred.
Return Value
A computation that defers the execution of the provided function.
-
later(_:)
Extension methodProvides a computation that evaluates the provided function on every run.
Declaration
Swift
static func later<A>(_ f: @escaping () throws -> A) -> Kind<Self, A>
Parameters
f
Function returning a value.
Return Value
A computation that defers the execution of the provided function.
-
later(_:)
Extension method -
lazy()
Extension methodProvides a lazy computation that returns void.
Declaration
Swift
static func lazy() -> Kind<Self, Void>
Return Value
A deferred computation of the void value.
-
laterOrRaise(_:)
Extension methodProvides a computation that evaluates the provided function on every run.
Parameters
f
A function that provides a value or an error.
Return Value
A computation that defers the execution of the provided value.