Proposal: Add First and Last wrappers around Maybe to Data.Monoid

Jeffrey Yasskin jyasskin at gmail.com
Fri Mar 9 02:03:00 EST 2007


I've attached a second version of the patch to the ticket
(http://hackage.haskell.org/trac/ghc/ticket/1189) along with the HTML
Haddock generates from it. I added the two examples and the "imposed
identity" instance directly on Maybe. Would one of its fans like to
provide an example of using the Maybe monoid?

On 3/7/07, John Meacham <john at repetae.net> wrote:
> Would it be possible to move these wrappers and other data types out of
> Data.Monoid and into something like
> Data.Monoid.(Wrappers|Util|Combinators) or something like that?
>
> A huge amount of useful namespace is eaten by them and Data.Monoid is an
> extremely common thing to need to import.
>
> I mean Dual,Endo,All,Any,Sum,Product are definitely useful, but way to
> common and generically useful names to export from such a often imported
> package.

Arguably, the monoid wrappers around a particular type should go with
that type instead of in Data.Monoid. That would mean my change would
be to Data.Maybe instead of here, and All, Any, Sum, and Product would
go in the Data.Bool and the Prelude (or Data.Num?). I don't care a
whole lot, but unless there's a consensus to move things around, I
think my change should just follow the status quo.

Thanks,
Jeffrey


More information about the Libraries mailing list