Proposal: Add default instances for Functor and Applicative

Duncan Coutts duncan.coutts at
Sat Sep 24 00:46:35 CEST 2011

On 23 September 2011 21:25, Maciej Marcin Piechotka
<uzytkownik2 at> wrote:
> The problem of backward compatibility have been the main obstacle
> against adopting Functor f => (Pointed f =>?) => Applicative f => Monad
> f.
> This proposition is to add following default instances[1]:

Sorry, I'm confused! The [1] link is about default superclass
instances, not default signatures. As I understand it, default
superclass instances are not implemented yet.

I fully support the general aim and default superclass instances look
like a very sensible way of addressing the problem. It's just not
clear to me how the default signatures you're suggesting here get us
closer to the goal.

Perhaps you can explain it a bit more. I suspect other people on this
list don't quite get it either.

> default fmap :: Applicative f => (a -> b) -> f a -> f b
> f `fmap` m = pure f <*> m
> default pure :: Monad f => a -> f a
> pure = return
> default (<*>) :: Monad f => f (a -> b) -> f a -> f b
> (<*>) = liftM2 ($)


More information about the Libraries mailing list