David Menendez wrote:
On Dec 11, 2007 9:20 AM, Duncan Coutts <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    So my suggestion is that we let classes declare default implementations
    of methods from super-classes.

<snip.

    Does this proposal have any unintended consequences? I'm not sure.
    Please discuss :-)


It creates ambiguity if two classes declare defaults for a common superclass.

My standard example involves Functor, Monad, and Comonad. Both Monad and Comonad could provide a default implementation for fmap. But let's say I have a type which is both a Monad and a Comonad: which default implementation gets used?

I'm disappointed to see this objection isn't listed on the wiki.

Doesn't sound like a very big problem. That would just be a compile time error ("More than one default for fmap possible for Foo, please reslve ambiguity").

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

Reply via email to