0.1.1 • Published 9 years ago

komposit v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

komposit

For creating functional compositions.

komposit(functions...)

Creates a composite function out of supplied argument functions. komposite(f,g,h)(x) is equivalent to h(g(f(x)))

var add10 = function (n) { return n + 10; };
var divideBy2 = function (n) { return n / 2; };

divideBy2(add10(20)) // 15

var add10AndDivideBy2 = komposit(add10, divide2);

add10AndDivideBy2(20) // 15