jon.fairbairn: > I find myself dismayed that the mathematical relationship > between Monads and Functors isn't available in Haskell98; if > I use fmap in a Monad m=>... typed function, I get an extra > Functor m required in the context, but not only are all > mathematical monads functors, any instance of Monad has fmap > in the form (>>= return . f), so it's annoying.
For interest. Here's the defn in the Gofer prelude from 1994: class Functor f where map :: (a -> b) -> (f a -> f b) class Functor m => Monad m where result :: a -> m a join :: m (m a) -> m a bind :: m a -> (a -> m b) -> m b join x = bind x id x `bind` f = join (map f x) class Monad m => Monad0 m where zero :: m a http://www.cse.unsw.edu.au/~dons/data/cc.prelude -- Don _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime