fun-js
Functional Programming for Javascript
install
node
$ npm install fun-js
browser
Drop fun.js into your project and see usage below.
test
$ ./test
See project page for test suite output.
usage
Note: fun-js adds a method called 'autoCurry' to Function.prototype
node.js
var assert = ; // import *everything* into the global contextvar fun = ; // Curryingvar findBrians = ;assert; // Compositionvar hasBrian = ;assert; var beatles = name : "John" name : "Paul" name : "George" name : "Ringo" name : "Brian" ; ; // Another way of making a hasBrian function...var isBrian = ;var hasBrian2 = ;;
browser
// global reference stored under window.fun...// selectively import 'curry' and 'compose' into the global contextfun; if typeof curry !== "function" || typeof compose !== "function" throw "fun-js could not selectively import curry and compose";