defining "unzip" using foldr
Tom Pledger
Tom.Pledger@peace.com
Mon, 14 Jul 2003 08:22:54 +1200
John Mann writes:
| Hello, I'm working my way through Simon Thompson's
| Haskell book and am having trouble with an exercise
| where the goal is to define "unzip" using foldr.
| Lambda notation and ~ , as used in the Prelude
| definition of unzip, have not been introduced yet. Any
| help on this would be appreciated.
| John Mann
Try starting with the base case of the recursion.
Do you see any similarity between what unzip must do with the empty
list, and what foldr does with the empty list?
Regards,
Tom