[Haskell-cafe] Re: Currying
johan.gronqvist at gmail.com
Thu Jan 18 05:41:01 EST 2007
phiroc at free.fr skrev:
> what is so great about "currying"?
> What are its uses, apart from letting one define functions with less
Letting one apply them with less extra characters:
add x y = x + y
map (add 2) [1..5]
add (x,y) = x + y
let add2 y = add(2,y) in map add2 [1..5] end
(The last might not technically be partial application, but it serves
the same purpose without using currying.)
I believe it makes code shorter and more readable, but I do not believe
it gives more power.
More information about the Haskell-Cafe