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

2006-03-01 Thread Johannes Waldmann
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

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

2006-03-01 Thread Jim Apple
On 3/1/06, Johannes Waldmann [EMAIL PROTECTED] wrote: 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 understand this for Monad. Why not just redefine Functor, Oleg-style? I couldn't use ghc's

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

2006-02-28 Thread Johannes Waldmann
Malcolm Wallace wrote: But if contexts-on-datatypes worked correctly, data Set a = Ord a = then even the real map from Data.Set: map :: (Ord a, Ord b) = (a - b) - Set a - Set b could be an instance method of Functor. I'd love that. But I don't quite understand: do you

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

2006-02-28 Thread Malcolm Wallace
But if contexts-on-datatypes worked correctly, data Set a = Ord a = then even the real map from Data.Set: map :: (Ord a, Ord b) = (a - b) - Set a - Set b could be an instance method of Functor. I'd love that. But I don't quite understand: do you think this

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

2006-02-28 Thread Jim Apple
On 2/28/06, Johannes Waldmann [EMAIL PROTECTED] wrote: Malcolm Wallace wrote: But if contexts-on-datatypes worked correctly, data Set a = Ord a = then even the real map from Data.Set: map :: (Ord a, Ord b) = (a - b) - Set a - Set b could be an instance method of