2.0.1 • Published 9 years ago
wi-jit v2.0.1
Wi-Jit 
npm install wi-jitA very minimal set of functional utilities. Just enough to get you going.
API
Strict
apply :: (a -> b) -> a -> bcompose :: (b -> c) -> (a -> b) -> a -> cconstant :: a -> b -> acurry :: ((a, b) -> c) -> a -> b -> cflip :: (a -> b -> c) -> b -> a -> cid :: a -> aon :: (b -> b -> c) -> (a -> b) -> a -> a -> cuncurry :: (a -> b -> c) -> (a, b) -> cNon-Strict
There are also some helpful variations on these functions included to be a bit better-suited to the style of JavaScript's syntax:
composeN: takes any number of functions and composes them all together.
composeN(f, g, h) == compose(compose(f, g), h)curryN: take an n-ary function, and return a totally curried version (unlike standardcurry, which only works on binary functions).
curryN((a, b, c) => a + b + c)(1)(2)(3) == 6uncurryN: take a curried function, and return a function that takes some (or all) of the arguments. If not given the total list, the result will beuncurryN(f), wherefis function that takes the remainder of the arguments.
uncurryN(f)(a, b, c)
== uncurryN(f)(a, b)(c)
== uncurryN(f)(a)(b, c)
== uncurryN(f)(a)(b)(c)Contributing
Send PRs! Get involved!