Out of (perhaps naive) curiosity, what difficulties does allowing such
overriding introduce? Wouldn't the module system prevent the ambiguity
of which implementation to use?

August Sodora
[email protected]
(201) 280-8138



On Sun, Jul 24, 2011 at 11:55 PM, Ivan Lazar Miljenovic
<[email protected]> wrote:
> On 25 July 2011 13:50, Sebastien Zany <[email protected]> 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
> [email protected]
> IvanMiljenovic.wordpress.com
>
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to