Extension methods for functions with arity 1 (functions that take exactly 1 argument).

Static methods

staticinline compose<TIn, TRet1, TRet2> (fa:TRet2 ‑> TRet1, fb:TIn ‑> TRet2):TIn ‑> TRet1

compose returns a function that calls the first argument function with the result of the following one.

staticinline contramap<A, B, C> (fbc:B ‑> C, fab:A ‑> B):A ‑> C

The contravariant functor for Function1<_, B>. Equivalent to compose.

staticfn<T, T2> (fn:T ‑> T2, restArgs:Dynamic):Dynamic

Lambda expressions

staticinline join<TIn> (fa:TIn ‑> Void, fb:TIn ‑> Void):TIn ‑> Void

join creates a function that calls the 2 functions passed as arguments in sequence and passes the same argument value to the both of them.

staticinline map<A, B, C> (fab:A ‑> B, fbc:B ‑> C):A ‑> C

The covariant functor for Function1

staticmemoize<TIn, TOut> (callback:TIn ‑> TOut, ?resolver:TIn ‑> String):TIn ‑> TOut

memoize wraps callback and calls it only once storing the result for future needs.

Computed results are stored in an internal map. The keys to this map are generated by the resolver function that by default directly converts the first argument into a string.

staticinline negate<T1> (callback:T1 ‑> Bool):T1 ‑> Bool

Wraps callback in a function that negates its results.

staticnoop<T> (_:T):Void

noop is a function that has no side effects and doesn't return any value.

staticinline swapArguments<T1, T2, TReturn> (callback:T1 ‑> T2 ‑> TReturn):T2 ‑> T1 ‑> TReturn

Returns a function that behaves the same as callback but has its arguments inverted.

staticinline times<TIn, TOut> (n:Int, callback:TIn ‑> TOut):TIn ‑> Array<TOut>

Creates a function that calls callback n times and returns an array of results.

staticinline timesi<TIn, TOut> (n:Int, callback:TIn ‑> Int ‑> TOut):TIn ‑> Array<TOut>

Creates a function that calls callback n times and returns an array of results.

Callback takes an additional argument index.