In opposition of Functor as super-class of Monad
Isaac Dupree
ml at isaac.cedarswampstudios.org
Wed Jan 5 19:58:16 CET 2011
Tony, you're missing the point... Alexey isn't making a complete patch
to GHC/base libraries, just a hacky-looking demonstration. Alexey is
saying that in a class hierarchy (such as if Functor => Monad were a
hierarchy, or for that matter "XFunctor"=>"XMonad" or Eq => Ord), it is
still possible to define the superclass functions (fmap) in terms of the
subclass functions (return and >>=) (such as writing a functor instance
in which "fmap f m = m >>= (return . f)"). This has always been true in
Haskell, it just might not have been obvious.
More information about the Haskell-prime
mailing list