Re: [Haskell-cafe] Map in Terms of Fold in terms of Map

Hi Mark,
What's the definition of foldr in terms of map? As far as I was aware,
its not possible.
And as it happens, map is (or is sometimes) defined in term of foldr
:-) While you can use mutual recursion, you can't define a in terms of
b and b in terms of a unless one of them actually does something at
the end - so it does depend exactly what the definitions are.
Thanks
Neil
2009/3/16 Mark Spezzano
Hi,
I’ve noticed that it’s possible to define map as foldr and foldr as a map. Would this be sensible to define both in terms of each other in the Prelude? i.e mutually recursive?
Cheers,
Mark
No virus found in this outgoing message. Checked by AVG. Version: 7.5.557 / Virus Database: 270.11.15/2003 - Release Date: 15/03/2009 2:07 PM
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (1)
-
Neil Mitchell