map and fmap

Taral taralx at
Mon Aug 28 18:57:48 EDT 2006

On 8/28/06, John Hughes <rjmh at> wrote:
> As for an example of fmap causing trouble, recall the code I posted last
> week sometime:
> class Foldable f where
>   fold :: (a -> a -> a) -> a -> f a -> a

I'd call this a case of "Foldable" causing trouble. :) Fold is
somewhat specific to the structure of the underlying collection (hence
the numerous fold* functions), map is not.

Taral <taralx at>
"You can't prove anything."
    -- Gödel's Incompetence Theorem

More information about the Haskell-prime mailing list