Proposal: Make Semigroup and Monoid instances for Data.Functor.Compose
Carter Schonwald
carter.schonwald at gmail.com
Fri Jul 26 18:10:41 UTC 2019
Ryan, sounds good to me
On Fri, Jul 26, 2019 at 9:17 AM Ryan Scott <ryan.gl.scott at gmail.com> wrote:
> Hi,
>
> You may find the discussion at
> https://mail.haskell.org/pipermail/libraries/2018-February/028571.html
> interesting. The summarized version of that post is that
> Data.Functor.Compose was originally brought over from the transformers
> library, which adheres to a very Haskell98 mindset in its design. In
> particular, the maintainer of transformers would likely not have added
> the Semigroup or Monoid instances you propose, since they require the
> FlexibleContexts language extension. This explains why there exists an
> `instance (Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a)` and not an
> `instance Eq (f (g a)) => Eq (Compose f g a)`, among other things.
>
> Of course, Data.Functor.Compose now lives in the base library, not
> transformers, so we need not prescribe to the same design philosophy.
> I don't feel too strongly about the issue, so if other people feel
> like adding Semigroup/Monoid instances that require FlexibleContexts
> is a good idea, I could get on board with that. What do others think?
>
> Ryan S.
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190726/b75abab1/attachment.html>
More information about the Libraries
mailing list