The FunctorM library
Simon Marlow
simonmar at microsoft.com
Mon Mar 21 04:20:50 EST 2005
On 21 March 2005 01:46, Iavor Diatchki wrote:
> On Mon, 21 Mar 2005 00:29:38 +0100, Thomas Jäger <thjaeger at gmail.com>
>> It is already annyoing enough that `Funtor' isn't a subclass of
>> `Monad' although every monad must also be functor.
>
> I think you are right. Does anyone remember why "Functor" is not a
> superclass of "Monad"?
I think it is because it doesn't need to be. The current situation is slightly more flexible: you don't *have* to provide a Functor instance for every Monad instance. On the other hand, it means you occasionally have to write an additional Functor context in types. You can always get around that by defining
class (Functor m, Monad m) => Monad' m where {}
Cheers,
Simon
More information about the Libraries
mailing list