instance Functor Set, was: Re: Export lists in modules

Johannes Waldmann waldmann at
Wed Mar 1 03:07:34 EST 2006

Jim Apple wrote:

> class MyMap f a b where
>     myMap :: (a -> b) -> f a -> f b
> instance (Functor f) => MyMap f a b where
>     myMap = fmap
> instance (Ord a, Ord b) => MyMap Data.Set.Set a b where
>     myMap =

OK (I guess).

But my point was that I want to use
"do notation" for Sets (in fact, for any kind of collection)
so I'd need the original Functor and Monad.

I couldn't use ghc's Rebindable Syntax feature
because the types for (>>=) would not match?

Best regards,
-- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 --
---- -------

More information about the Haskell-prime mailing list