Functions for working with Thunks
staticenclose<R> (f:Thunk<R>):Block
Takes a function that returns a result, and produces one that ignores that result.
staticmemoize<T> (t:Thunk<T>):Thunk<T>
Returns a Thunk that applies a Thunk one time only and stores the result, after which each successive call returns the stored value.
staticpromote<A, Z> (f:Void ‑> Z):A ‑> Z
Produces a function that takes a parameter. ignores it, and calls f
, returning it's result.
staticreturning<R1, R2> (f:Void ‑> R1, thunk:Thunk<R2>):Thunk<R2>
Produces a function that calls f
, ignores its result, and returns the result produced by thunk.
staticstage<Z, T> (f:Thunk<Z>, before:Void ‑> T, after:T ‑> Void):Z
Produces a function that calls and stores the result of 'before', then f
, then calls after
with the result of
before
and finally returns the result of f
.
staticsuppress<A> (th:Thunk<A>):Thunk<Null<A>>
Ignores error in th
when called, instead returning a null