All Monads are Functors

John Meacham john at repetae.net
Mon Aug 14 09:13:42 EDT 2006


On Mon, Aug 14, 2006 at 12:02:58AM -0500, Taral wrote:
> In my opinion, an instance definition of a subclass should allow the
> superclass's methods to be defined as if they were part of the
> subclass, e.g.:
> 
> instance Monad [] where
>    fmap = map
>    return x = [x]
>    join = concat
> 
> It's so pretty! (But a little inefficient. You'd probably want to
> define ap/lift2 in there.)

This is actually a big can of worms to allow despite looking simple at
first. it was discussed during the class aliases thread.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell-prime mailing list