[Haskell-cafe] Re: class default method proposal

2007-12-13 Thread apfelmus
Luke Palmer wrote: Isn't a type which is both a Monad and a Comonad just Identity? (I'm actually not sure, I'm just conjecting) Good idea, but it's not the case. data L a = One a | Cons a (L a) -- non-empty list -- standard list monad instance Monad L where return = One

[Haskell-cafe] Re: class default method proposal

2007-12-13 Thread Jon Fairbairn
Duncan Coutts [EMAIL PROTECTED] writes: We all know that Functor should have been a superclass of Monad, and indeed we now know that Applicative should be too. Making such a change would break lots of things however so the change does not happen. However in this case the Monad operations can

[Haskell-cafe] Re: class default method proposal

2007-12-11 Thread apfelmus
Jules Bean wrote: David Menendez wrote: Duncan Coutts wrote: So my suggestion is that we let classes declare default implementations of methods from super-classes. It creates ambiguity if two classes declare defaults for a common superclass. My standard example involves Functor, Monad,