2.0.0 • Published 5 years ago
@functional-things/compose v2.0.0
@functional-things/compose
Function composition utilities for TypeScript.
This package provides functional composition utilities for TypeScript.
Specifically, it provides two functions: compose and composeRight.
Install
$ npm install --save @functional-things/composeUsage
compose
compose composes arity-one (single argument) functions in the order written.
This means that compose(f, g, h)(x) results in: h(g(f(x))). While not the
traditional way of composing functions, this makes logical sense, since the
first function given to compose is applied first.
composeRight
composeRight, like compose, composes arity-one (single argument) functions.
However, composeRight composes these functions from right to left. This
matches the more traditional way of composing functions.
To given an examle: composeRight(f, g, h)(x) becomes f(g(h(x))).
2.0.0
5 years ago
1.0.0-rc.1
5 years ago