Closed chshersh closed 6 years ago
We already had (<>)
from Semigroup in Universum and then we changed it because it was too much hassle ;)
@neongreen Can you give an example of that? Probably I didn't face this issue...
IIRC there were some types without Semigroup
instances and so we had to import the Monoid (<>)
fairly often. I don't remember which types those were.
We should've added Semigroup instances upstream, since it's in base
Meanwhile I have found the relevant commit and it looks like there were only six modules where we had to hide (<>)
from Universum. We are also using NonEmpty
more often now so I guess I'm fine with exporting (<>)
from Semigroup
instead of Monoid
provided that we also export mappend
.
We can just use mappend
if we need Monoid
.
When Semigroup => Monoid
lands in GHC 8.4.1 it will become much easier to migrate. Especially if we try by ourselves to use Semigroup
instead of Monoid
as much as possible.
IIRC, most annoying example was some famous type from optparse-applicative
.
@gromakovsky This data type has instance Semigroup
in last version of optparse-applicative
.
For example, it's not very convenient to use
Semigroup.<>
when you need to appendNonEmpty a
.