[Haskell-beginners] A post about Currying and Partial application

Petar Radosevic petar at wunki.org
Sat Oct 1 14:40:15 CEST 2011


Peter Hall wrote the following on Sat, Oct 01, 2011 at 10:49:31AM +0100:
> I think this sentence isn't right:
> 
> "Curried functions are functions that only take one parameter."
> 
> The way I understand it, a non-curried function takes only one
> parameter. Currying is syntactic sugar so you don't have to use
> higher-order functions every time you want multiple parameters.
> 
> Without currying, if you wanted a function like:
> 
>     f a b c = 2 * a + b - c
> 
> , you'd have to write it something like:
> 
>   f a = f1
>       where f1 b = f2
>           where f2 c = 2 * a + b - c
> 
> or
> 
>    f a = (\b -> (\c ->  2*a + b -c))

You are right, I changed the sentence to better reflect wat currying
really is. Thank you for your input.

-- 
Petar Radošević, Programmer
wunki.org | @wunki



More information about the Beginners mailing list