15 Aug
2006
15 Aug
'06
9:25 p.m.
On 8/15/06, Bulat Ziganshin <bulat.ziganshin@gmail.com> wrote:
in this case we lose "class Functor a => Monad a" base class declaration. so what will be the meaning of this:
I don't see why that is the case. class Functor m => Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b instance Functor m where fmap f = (>>= return . f) What's wrong with this? All Monads are Functors. If you don't provide a Functor, it gets defined for you. The problem is working out whether to use the default Functor or an external Functor. -- Taral <taralx@gmail.com> "You can't prove anything." -- Gödel's Incompetence Theorem