Readit News logoReadit News
curry_is_easy commented on Currying   wiki.haskell.org/Currying... · Posted by u/peter_d_sherman
solardev · 2 years ago
In my entire life as a programmer, this is the one thing that I've found most confusing. Our old codebase used a lot of curried Ramda functions and nobody on the team could read any of it. We spent a week ripping every single instance of it out and replaced it with regular lodash and never looked back and never had an issue with it again.

After like ten or fifteen hours of trying to understand what currying is, I still have no idea, and frankly don't care. If I see it in a codebase it'd just be a big red flag to avoid that job altogether.

curry_is_easy · 2 years ago
Since you know JavaScript, this should help.

Uncurried:

((x, y) => x * y)(3, 5) === 15

Curried:

(x => y => x * y)(3)(5) === 15

If you don't understand that, your problem is that you don't understand anonymous functions (lambdas), not that you don't understand currying.

u/curry_is_easy

KarmaCake day3April 7, 2024View Original