in reply to RFC: A Perlesque Introduction to Haskell, Part One (DRAFT)
What you call extensionality is what I've known as currying. And a description of it will probably be easier if you talk more about type signatures and type inferencing.
In my opinion, the absolute coolest features of modern function languages (other than just being functional) are type inferencing and pattern matching. They are foreign concepts if your only programming background is Perl (especially type inferencing), so you should give them both a bit more time. Other cool features that you do mention are polymorphic types (Num a), and lazy evaluation of infinite objects (which I've never had any experience with).
As for patternmatching, the absolute coolest demonstration of this is quicksort in 2 or 3 lines of Haskell (Update: code here). It shows how elegant and powerful patternmatching can be... especially in Haskell, which has the most expressive matching out there.
WRT currying, it's easy to grasp by having a good understanding of what the type signatures mean  plus it gives you a bit of insight into the language internals as well. The type signatures for multiarg functions look like this:
Note that there are no parens in the signature a > a > a. This is a function of two variables, so why isn't the signature something like (a, a) > a ?? Turns out that arrow is rightassociative, so the type signature really means:sum x y = x + y sum :: Num a => a > a > a
When you read it this way, you can see that sum is a function of one variable that returns another function of one variable. Under this view (the lambdacalculus view), currying is simply a natural sideeffect:sum :: Num a => a > (a > a)
sum 1 returned a function of one variable (a > a), just like the type signature said it would! It's also important to notice that at this point, the typeinferencing engine may have specified the polymorphic type a to an Int type (don't know Haskell well enough to say for sure).increment = sum 1
Function application on multiple arguments also makes sense under this interpretation as a leftassociative operation:
Multiple arguments and currying just come naturally by looking at functions from a lambda calculus context.sum 1 2 ## really means (sum 1) 2 ## which is (\y > 1 + y) 2 ## 1 + 2
Also, MJD has a Perlbased talk about Strong typing that uses ML and gives a good example about how type inferencing helps the programmer catch bugs (I can attest to that).
Anyway, you're making me want to write an OCaml primer (and learn Haskell) ;) Good work so far!
blokhead


Replies are listed 'Best First'.  

Re^2: RFC: A Perlesque Introduction to Haskell, Part One (draft)
by FoxtrotUniform (Prior) on Jun 23, 2004 at 22:26 UTC  
Re^2: RFC: A Perlesque Introduction to Haskell, Part One (draft)
by runrig (Abbot) on Jun 23, 2004 at 23:46 UTC  
by Errto (Vicar) on Jun 24, 2004 at 01:29 UTC  
by ihb (Deacon) on Jun 24, 2004 at 02:28 UTC 