A small library of Functional Programming functions
Combines a list of monadic (single parameter) functions into a single new function that expects a single input parameter.
- args: a number of monadic (single parameter) functions.
A new monadic function that is a combination of all those provided.
Converts the given variadic function into one that expects arguments to be supplied one at a time.
- fn: variadic function to convert into a curried function.
- _args: private array of arguments accumulated prior to execution.
A curried function.
Creates a repeatable function for extracting values out of objects/arrays at a given location (property/subscript).
- props: one or more propertyNames or array subscripts, either individually or in strings.
A lookup function to return the value of a property at the stated location, for a given object.
Creates a repeatable function for extracting values out of objects/arrays at a given location (property/subscript) and apply the specified function on the property and the entire object.
- fn: transformation to be applied to each value returned by the lens operation.
- props: one or more propertyNames or array subscripts, either individually or in strings.
A lookup function to lookup the value of a property at the stated location, for a given object, and return the value of an applied function.
Converts the given pure function into on that is optimised using memoisation (caching.)
- fn: pure function to convert into a memoised function.
- _cache: private cache of function executions.
A memoised function.