Functor => Pointed => Applicative => Monad

Isaac Dupree ml at
Mon Nov 29 17:26:34 CET 2010

On 11/29/10 03:39, John Smith wrote:
> Is there any intention to reorganise the standard class hierarchy,
> arranging them logically instead of in order of invention? I plagiarised
> the following example from
> and Trac:
> class Functor f where
> map :: (a -> b) -> f a -> f b
> class Functor f => Pointed f where
> pure :: a -> f a

Is it useful to have Pointed non-Functors?  (I.e. not superclass).  Er, 
Data.Set is the only example I've come up with (its 'singleton' doesn't 
require Ord on elements but its 'map' does).  Then you'd have things like

class (Pointed f, Functor f) => Applicative f where

Cons: Pointed doesn't have any laws without Functor
Pros: (pure) might be useful to use generically by itself


More information about the Libraries mailing list