
1 Mar
2006
1 Mar
'06
3:07 a.m.
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 = Data.Set.map
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? http://www.haskell.org/ghc/docs/6.4/html/users_guide/syntax-extns.html#rebin... Best regards, -- -- Johannes Waldmann -- Tel/Fax (0341) 3076 6479/80 -- ---- http://www.imn.htwk-leipzig.de/~waldmann/ -------