Retain function name after curry
I saw #1678, but it's an old one and didn't get any traction. How would you feel about implementing this, at least, for curry and curryN? The idea is that functions returned by curry/curryN would keep the name of the original function passed as argument. Intermediate functions (returned before supplying all arguments) should also be aptly named.
> const { curry } = require('ramda');
undefined
> const sum = curry(function sum(a, b) { return a + b; });
undefined
> sum.name // currently -> ''
'sum'
> sum(42).name // currently -> ''
'sum'
I have a very simple, but working implementation of this, leveraging Object.defineProperty. Would you be up for a PR?
Feel free to create a PR. I'm looking at large changes for after 1.0 that would definitely include something like this.
@CrossEye Here: https://github.com/ramda/ramda/pull/2782. Let me know your feedback.
wouldn't this be a little counter intuitive when debugging?
if I curry the function sum and call it curriedSum I expect to see curriedSum in my call stack.
seeing it in node CLI also looks confusing.
{ sum: [Function: sum], curriedSum: [Function: sum] }
edit: nevermind, I just noticed the date