https://github.com/stevemao/inspect-curry
curry with debuggable glory
https://github.com/stevemao/inspect-curry
Last synced: 2 months ago
JSON representation
curry with debuggable glory
- Host: GitHub
- URL: https://github.com/stevemao/inspect-curry
- Owner: stevemao
- Created: 2017-05-21T01:14:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T02:19:50.000Z (over 8 years ago)
- Last Synced: 2025-07-29T23:21:53.890Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Problem
```js
var add = curry(function add(x, y){ return x + y });
var map = curry(function map(f, xs){ return xs.map(f) });
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
```js
console.log(inc)
// function f2() {
// return f1.apply(null, args.concat(Array.prototype.slice.call(arguments, 0)));
// }
```
# After
```js
console.log(inc)
// map(add(1))
```
See https://medium.com/@drboolean/debugging-functional-7deb4688a08c
# Related
- [inspect-compose](https://github.com/stevemao/inspect-compose)
- [composition-trace](https://github.com/stevemao/composition-trace)