[Haskell-cafe] Why the reluctance to introduce the Functor requirement on Monad?
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Mon Jul 25 05:55:08 CEST 2011
On 25 July 2011 13:50, Sebastien Zany <sebastien at chaoticresearch.com> wrote:
> I was thinking the reverse. We can already give default implementations of class operations that can be overridden by giving them explicitly when we declare instances, so why shouldn't we be able to give default implementations of operations of more general classes, which could be overridden by a separate instance declaration for these?
>
> Then I could say something like "a monad is also automatically a functor with fmap by default given by..." and if I wanted to give a more efficient fmap for a particular monad I would just instantiate it as a functor explicitly.
I believe this has been proposed before, but a major problem is that
you cannot do such overriding.
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
More information about the Haskell-Cafe
mailing list