> [...]
> unzip = foldr (\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[])
> 
> Not exactly intuitive. Could be better. I'm assuming that George's point
> is that this documentation leaves plenty of room for expansion.

OK, you fire up Hugs and type :t unzip and Hugs tells you that

unzip :: [(a,b)] -> ([a],[b])

Completely clear, unzip takes a list of pairs and returns a pair of lists. The nice 
thing about Haskell is that the type of a polymorphic function tells you a lot about 
what the function does. If you want to know how much, read Phil Wadler's "Theorems for 
Free!" paper, a paper every functional programmer should reread at least once a year.

Erik









Reply via email to