1.0.0 • Published 7 years ago

inspect-curry v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Problem

var add = curry(function add(x, y){ return x + y });
var map = curry(function map(f, xs){ return xs.map(f) });
var head = function(xs){ return xs[0] };

var inc = add(1);

When trying to console.log a function we’re presented with the guts of some internal curry implementation that tells us nothing.

Before

console.log(inc)
// function f2() {
//   return f1.apply(null, args.concat(Array.prototype.slice.call(arguments, 0)));
// }

After

console.log(inc)
// => map(add(1))

See https://medium.com/@drboolean/debugging-functional-7deb4688a08c

Related