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

Ross Paterson ross at soi.city.ac.uk
Thu Jan 6 12:16:56 CET 2011


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.



More information about the Libraries mailing list