Adding Applicative/Functor instances to all Monads in GHC

Conal Elliott conal at
Fri May 17 01:52:25 CEST 2013

+1 (yes, please).

On Thu, May 16, 2013 at 4:33 AM, David Luposchainsky <
dluposchainsky at> wrote:

> Hello everyone,
> I recently went through GHC's source, and discovered there are quite a
> few instances of Monad that don't have Functor or Applicative instances.
> Fixing this is very easy by adding the standard instances (pure = return
> etc.), and will not break code.
> There is one exception to this: Hoopl defines its own (<*>). However,
> since it does not seem to have any packages depend on it otherwise,
> renaming this operator is also easily done (the thing is only used ten
> times or so). I called it (<*|*>) to complement (|*><*|), but naming
> should be the least important issue here.
> Small piece of backstory:
> The idea behind this is making GHC future-proof for changing Applicative
> to be a superclass of Monad. However, I think adding the Applicative
> instances is a good idea regardless of whether this will ever happen, so
> that's the only thing I'm proposing right now.
> Greetings,
> David
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list