Proposal: Add default instances for Functor and Applicative

Maciej Marcin Piechotka uzytkownik2 at gmail.com
Sun Oct 23 20:31:43 CEST 2011


On Fri, 2011-09-23 at 22:25 +0200, Maciej Marcin Piechotka 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]:
> 
> 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 ($)
> 
> The proposition is intended as step towards implementing whole hierarchy
> of Functor f => (Pointed f =>?) => Applicative f => Monad f[2]
> 
> Discussion period: 2 weeks
> 
> Regards
> 
> [1] It's using DefaultSuperclassInstances extentions:
> http://hackage.haskell.org/trac/ghc/wiki/DefaultSuperclassInstances
> [2] Trivial implementation is shown here:
> http://thread.gmane.org/gmane.comp.lang.haskell.libraries/16196
> 
> I believe that in such case the Pointed instance comes at nearly zero
> cost.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries

Sorry for overdue summary.

From what I understend there was neither much oposition nor support for
the proposal. What's the procedure in such case?

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/libraries/attachments/20111023/f49a2b9a/attachment.pgp>


More information about the Libraries mailing list