#3339: Data.Monoid: Add (<>) as a synonym for mappend
-----------------------------+----------------------------------------------
Reporter: bos | Owner:
Type: proposal | Status: closed
Priority: normal | Milestone: Not GHC
Component: libraries/base | Version: 6.10.3
Resolution: invalid | Keywords:
Testcase: | Blockedby:
Difficulty: Unknown | Os: Unknown/Multiple
Blocking: | Architecture: Unknown/Multiple
Failure: None/Unknown |
-----------------------------+----------------------------------------------
Changes (by YitzGale):
* cc: gale@… (added)
Comment:
Since there is already so much discussion about the issue in this
ticket, I am adding this comment here:
This is an old proposal. I was in favor of it back in the day,
but now I am opposed, due to the existence of the semigroups package:
http://hackage.haskell.org/package/semigroups
This operator is already exported from Data.Semigroup.
Library authors who have Monoid instances should also
provide Semigroup instances. That makes the `<>`
operator available.
Exporting `<>` from Data.Monoid would break any code
that uses the synonymous operator from Data.Semigroup.
And anyway, it's incorrect - this is really a semigroup
operator, Monoid only adds the identity element.
Really Monoid should be a subclass of Semigroup, but that
would be difficult to do at this stage. It is similar to
the situation with Functor and Monad, unfortunately.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3339#comment:28>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs