Simon Peyton-Jones wrote:
|
| class Functor f where fmap :: ...
| class Functor m = Monad m where
| ...the usual stuff...
| fmap = liftM
|
It seems overkill to have a whole new language feature to deal with one
library issue.
Perhaps it is...
For example, what if
| Yes, I think this should be fixed, and perhaps it could be done in a
| backward compatible way? If classes were allowed to declare default
| methods for superclasses, then you could have
|
| class Functor f where fmap :: ...
| class Functor m = Monad m where
| ...the usual
Why not just have the new definition with a different import path, so
that legacy code continues to do:
import Control.Monad
And new code could do:
import Control.Category.Monad (or something)
And we could take this opportunity to incorporate premonads...
class Functor f -- defines fmap
class
On Thu, Mar 24, 2005 at 08:40:14AM -, Simon Peyton-Jones wrote:
[Thomas Hallgren wrote:]
| Yes, I think this should be fixed, and perhaps it could be done in a
| backward compatible way? If classes were allowed to declare default
| methods for superclasses, then you could have
|
|
On Wed, 23 Mar 2005 19:14:41 -0800, Thomas Hallgren
[EMAIL PROTECTED] wrote:
Iavor Diatchki wrote:
Just to avoid confusion I think the suggestions were:
class Functor f = Monad f where ...
class Functor f = FunctorM f where ...
I know the first one differs from the Haskell report, but
On Wed, Mar 23, 2005 at 11:29:51PM -0500, Cale Gibbard wrote:
I agree, and think that's a great idea for solving that problem.
Does anyone see any possible difficulties with it?
I think that perhaps specifying the entire instance might make more sense, eg:
class Functor m = Monad m where