> [...] > 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
- Haskell Wish list: library documentation George Russell
- Re: Haskell Wish list: library documentation S. Alexander Jacobson
- Re: Haskell Wish list: library documentation D. Tweed
- Re: Haskell Wish list: library documentation Michael Hobbs
- Re: Haskell Wish list: library documentation S. Alexander Jacobson
- Re: Haskell Wish list: library documentation Jon . Fairbairn
- Re: Haskell Wish list: library documentation Keith Wansbrough
- Re: Haskell Wish list: library documentation Erik Meijer
- Re: Haskell Wish list: library documentation Peter Hancock
- Re: Haskell Wish list: library documentation Michael T. Richter
- Re: Haskell Wish list: library documentation Andy Gill
- Re: Haskell Wish list: library documentation Michael T. Richter
- Re: Haskell Wish list: library documentation Michael Hobbs
- Re: Haskell Wish list: library documentation Andy Gill
- Re: Haskell Wish list: library documentation Andy Gill
- Re: Haskell Wish list: library documentation John Peterson
- Re: Haskell Wish list: library documentation S. Alexander Jacobson
- Re: Haskell Wish list: library documentation trb