News for hackers. Stuff that matters.
Re:Show HN: Omg-Curry – JavaScript currying library by ufo on Monday August 10, 2020 @06:02PM (#24114546)
I had mixed results in the past when I tried to use currying in Javascript. The stack traces were cluttered by references to the currying function and it also masked bugs if you forgot to pass an argument. Without currying, if you pass less arguments than the function expects then you usually get an error right away complaining that the argument is undefined. However, if the function is curried then it silently succeeds. You only notice the problem later, when you try to use the return value and realize that it is actually a function. To make things worse, when this happens the stack trace points to the place that is trying to use the return value instead of pointing to the function call that is the actual source of the problem.

My final impression was that currying works better a language like Haskell that has a strong type system. In a dynamic language it is more problematic.

Re:Show HN: Omg-Curry – JavaScript currying library by tutfbhuf on Tuesday August 11, 2020 @02:53AM (#24117826)
How about Typescript then?
Re:Show HN: Omg-Curry – JavaScript currying library by ufo on Tuesday August 11, 2020 @09:40AM (#24120136)
When I did that it was before Typescript existed. If anyone has tried currying with Typescript I'd love to hear how it went.