This is from Learn You A Haskell:

==========

"Curried functions

Every function in Haskell officially only takes one parameter. So how is it 
possible that we defined and used several functions that take more than one 
parameter so far? Well, it's a clever trick! All the functions that accepted 
several parameters so far have been curried functions. What does that mean? 
You'll understand it best on an example. Let's take our good friend, the max 
function. It looks like it takes two parameters and returns the one that's 
bigger. Doing max 4 5 first creates a function that takes a parameter and 
returns either 4 or that parameter, depending on which is bigger. Then, 5 IS 
APPLIED TO THAT FUNCTION and that function produces our desired result.

What really happens when we do multThree 3 5 9 or ((multThree 3) 5) 9? First, 3 
is applied to multThree, because they're separated by a space. That creates a 
function that takes one parameter and returns a function. So then 5 IS APPLIED 
TO THAT, which creates a function that will take a parameter and multiply it by 
15. 9 IS APPLIED TO THAT FUNCTION and the result is 135 or something."

=======

The language (in CAPS) in the above two paragraphs seems to be backwards. In 
the first paragraph, since functions are conventionally "applied" to parameters 
shouldn't it read something like THE PARTIALLY APPLIED FUNCTION IS THEN APPLIED 
TO the 5? Or is the terminology different for Haskell, as opposed to say, 
Scheme or just about any other language?

Michael


      
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to