Common functions that operate on other functions

Static methods

staticinlineap<A, B>(fn:A ‑> B, a:A):B

Calls a function with a single argument.
Can be called repeatedly if the return type is a function

staticinlineflip<A, B, C>(fn:(A, B) ‑> C):(B, A) ‑> C

Swaps the order of two function arguments

staticinlinegen<A>(generator:() ‑> A):A

Calls a function that generates a value from nothing

staticinlinenot<A>(fn:A ‑> Bool):A ‑> Bool

Produces a function that inverts the result of a function returning Bool

staticinlineof<A, B, C>(bc:B ‑> C, ab:A ‑> B):A ‑> C

Composes two functions

staticinlineto<A, B, C>(ab:A ‑> B, bc:B ‑> C):A ‑> C

Composes two functions in reverse order, like a pipeline operator

statictoLazy<A>(generator:() ‑> A):Lazy<A>

staticinlinewhen<A, B>(transform:A ‑> B, predicate:A ‑> Bool):A ‑> Option<B>

Builds a function that returns a transformed value if it matches some predicate, or None if it doesn't