Class for working with Unary Functions.
staticcatching<A, B> (fn:A ‑> B):A ‑> Outcome<B, Error>
Applies a Thunk and returns Either an error or it's result
staticcurry<P1, R> (f:P1 ‑> R):Void ‑> P1 ‑> R
Produces a function that produces a function for each parameter in the originating function. When these functions have been called, the result of the original function is produced.
staticinline defer<P1, R> (f:P1 ‑> R, p1:P1):Thunk<R>
As with lazy, but calls the wrapped function every time it is called.
staticinline lazy<P1, R> (f:P1 ‑> R, p1:P1):Thunk<R>
Produces a function that calls f
with the given parameters p1....pn
,
calls this function only once and memoizes the result.
staticreturning<P1, R1, R2> (f:P1 ‑> R1, thunk:Thunk<R2>):P1 ‑> R2
Produces a function that calls f
, ignores its result, and returns the result
produced by thunk.
staticswallow<A> (f:A ‑> Void):A ‑> Void
Produces a function that ignores any error the occurs whilst calling the input function.
staticswallowWith<P1, R> (f:P1 ‑> R, d:R):P1 ‑> R
Produces a function that ignores
any error the occurs whilst calling the input function, and produces d
if
error occurs.