[Haskell-cafe] Re: Currying

Johan Grönqvist johan.gronqvist at gmail.com
Thu Jan 18 05:41:01 EST 2007


phiroc at free.fr skrev:
> Hello,
> 
> what is so great about "currying"?
> 
> What are its uses, apart from letting one define functions with less
> parentheses?

Letting one apply them with less extra characters:

add x y = x + y
map (add 2) [1..5]

instead of
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.

/ johan



More information about the Haskell-Cafe mailing list