
5 Jan
2011
5 Jan
'11
1:58 p.m.
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.