Proposal: Add instances for Functor, Monad, Applicative to Data.Monoid.First, Last

Ticket: http://hackage.haskell.org/trac/ghc/ticket/4880 This proposal adds missing instances for the two newtype wrappers for Maybe in Data.Monoid. A patch is attached to the ticket. Both the motivation and implementation are straightforward. Discussion period: 2 weeks (until 20 Jan 2011). Cheers, Sterl

This seems sensible, although I was for some reason sceptical at
first, but I'm unable to articulate why and the proposal seems
straightforward enough. So +1.
Antoine
On Wed, Jan 5, 2011 at 9:47 PM, Sterling Clover
Ticket: http://hackage.haskell.org/trac/ghc/ticket/4880
This proposal adds missing instances for the two newtype wrappers for Maybe in Data.Monoid. A patch is attached to the ticket. Both the motivation and implementation are straightforward.
Discussion period: 2 weeks (until 20 Jan 2011).
Cheers, Sterl
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Wed, Jan 05, 2011 at 10:47:17PM -0500, Sterling Clover wrote:
Ticket: http://hackage.haskell.org/trac/ghc/ticket/4880
This proposal adds missing instances for the two newtype wrappers for Maybe in Data.Monoid. A patch is attached to the ticket. Both the motivation and implementation are straightforward.
I can't think of a use for them, but on the principle that if there's a canonical instance it should be supplied, why not? Two things I'd change: * move the Functor and Monad instances to Data.Monoid to save them from being orphans. * add MonadPlus (in Data.Monoid) and Alternative instances that behave the same as the Monoid instances.
participants (3)
-
Antoine Latter
-
Ross Paterson
-
Sterling Clover