
12 Dec
2007
12 Dec
'07
11:10 p.m.
On Dec 11, 2007 3:19 PM, David Menendez
On Dec 11, 2007 9:20 AM, Duncan Coutts
wrote: So my suggestion is that we let classes declare default implementations of methods from super-classes.
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?
Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Luke