All Monads are Functors

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Aug 15 02:19:46 EDT 2006


Hello Taral,

Tuesday, August 15, 2006, 3:11:37 AM, you wrote:

>> > Do we complain about a duplicate instance declarations?
>>
>> yes. after all, this is just syntax sugar of giving both declarations:

> Not necessarily. If A doesn't have any Functor declarations, it could
> be considered just a Monad without a Functor.

in this case we lose "class Functor a => Monad a" base class
declaration. so what will be the meaning of this:

class Monad m where
  instance Functor m
  return :: ...
  ....

and this:

class Monad m where
  instance Functor m where
     fmap = return ...
  return :: ...
  ....

?



-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-prime mailing list