|
![](/i/fill.gif) |
On 22/04/2012 05:34 PM, clipka wrote:
> Maybe that's what scrambles my mind whenever I read "Haskellists'"
> explanations of stuff: They're so proud that Haskell does it
> automatically for you, that they tend to deny the obvious parallels.
>
> So yes: Currying *is* like writing a function that takes fewer
> arguments, calling the original one and supplying (unchangeable)
> defaults for the missing arguments.
>
> And yes, apparently Haskell provides syntactic sugar for that. Wow. Big
> deal.
>
>> Finally, like I said, currying works backwards too: If a function call
>> happens to return a function as its result, you can just keep appending
>> arguments. "head function_list 7" and all that.
>
> Again, nice-to-have syntactic sugar, but nothing conceptually
> fascinating (as you noted yourself).
You seem to be missing the third point: Function currying allows you to
write code that polymorphically accepts functions with ANY number of
arguments.
That can be a Big Deal.
That said, yeah, of all the things that Haskell does, function currying
is one of the less exciting ones.
Post a reply to this message
|
![](/i/fill.gif) |