Hacker News new | ask | show | jobs
by johan_larson 4110 days ago
I don't recall currying -- either the name or the concept -- being a particular stumbling-block for beginners trying to learn functional programming.

There isn't really a problem that needs solving here.

3 comments

Some languages, like ML family or Haskell, make it an organic part of the language, so beginners doesn't need to worry about the concept to use it.

When first exposed to ML/Haskell code, they may use simple mental models such as "you write function arguments without parens and commas" and "the last type in foo -> bar -> baz is the return type". Then it gets replaced with realization that "oh, so 'let f x y = x + y' is just a sugar for 'let f = fun x -> fun y -> x + y'".

If one is learning the concept in a language that supports functions of multiple arguments and uses something else than currying for built-in partial application mechanism, I can imagine them having problems with it. Learning how familiar things works internally is usually easier than learning "this is what you can do and why you may want it".

Actually it is the lack of currying that is a stumbling block when you go back to a language that doesn't have it.
Another name for this technique is "partial application".
No it is not. For an explanation see http://www.uncarved.com/blog/not_currying.mrk