id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4481	Functor, Pointed, Applicative, Monad	gidyn		"As pointed out on [http://stackoverflow.com/questions/1634911/can-liftm-differ-from-lifta StackOverflow], Functor, Pointed, Applicative and Monad all belong in a hierarchy thus:
{{{
class Functor f where
    map :: (a -> b) -> f a -> f b

class Functor f => Pointed f where
    pure :: a -> f a

class Pointed f => Applicative f where
    (<*>) :: f (a -> b) -> f a -> f b
    (*>) :: f a -> f b -> f b
    (<*) :: f a -> f b -> f a

class Applicative m => Monad m where
    (>>=) :: (m a) -> (a -> m b) -> m b
    (>>) :: m a -> m b -> m b
    return :: a -> m a
}}}
As well as eliminating much duplication (where every Applicative must also be given a Monad instance), this will make it easier to eliminate such duplication as [fmap,liftM,map,liftA], [(<*>),ap], and [concat,join].

fail does not belong in Monad; it only makes sense monadically as mzero."	proposal	closed	normal	Not GHC	libraries/base	6.12.3	invalid			Unknown/Multiple	Unknown/Multiple	None/Unknown					
