defining "unzip" using foldr

Tom Pledger <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.