DEV Community

Discussion on: Currying in Haskell (With Some JavaScript)

Collapse
 
arj profile image
arj • Edited

Nice article! At the beginning of the article you are mixing several concepts though (at the end some of it is cleared up):

  • currying is the fact that a function taking n arguments returns a function taking n-1 arguments if only one argument is applied
  • lazy evaluation is the fact that an expression returns a thunk instead of the actual result of the computation. The thunk then contains instructions how to compute the result later or, once the result has been computed, contains only the result.
  • function composition is the fact that 2 functions can be pointwise combined to a new function (see your comment)

These three concepts are independent but can be used together as you can see in Haskell.