
20 Oct
2007
20 Oct
'07
3:27 a.m.
Cale Gibbard wrote:
class Functor c m => Monad c m where return :: a -> m a join :: m (m a) -> m a (>>=) :: m a -> (c a (m b)) -> m b x >>= f = join (f . x) join x = x >>= id
We may even want return :: c () a -> m a since there doesn't need to be an embedding from (all of) Hask to c , i.e. the domain and image types may well be phantoms. Regards, apfelmus