inspect-curry

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i inspect-curry

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • stevemao