Functions for working with Thunks

Static methods

staticcatching<A, B> (c:Thunk<A>):Thunk<Outcome<A, Error>>

Applies a Thunk and returns an Outcome

staticenclose<R> (f:Thunk<R>):Block

Takes a function that returns a result, and produces one that ignores that result.

staticequals<A> (a:Thunk<A>, b:Thunk<A>):Bool

Compares function identity.

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.

staticreply<A> (a:Thunk<A>):A

Calls a Thunk.

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

staticswallow (f:Block):Block

Takes a function f and produces one that ignores any error the occurs whilst calling f.

staticthen<A, B> (fn0:Thunk<A>, fn1:A ‑> B):Thunk<B>

Produces a function that calls f1 and f2 in left to right order with the same input, and returns no result.

Returns:

The composite function.

staticinline toThunk<T> (v:T):Void ‑> T