Adding Applicative/Functor instances to all Monads in GHC
conal at conal.net
Fri May 17 01:52:25 CEST 2013
+1 (yes, please).
On Thu, May 16, 2013 at 4:33 AM, David Luposchainsky <
dluposchainsky at googlemail.com> 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.
> Libraries mailing list
> Libraries at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries