# Monoid-subclasses: Subclasses of Monoid

**URL:** <https://discourse.haskell.org/t/monoid-subclasses-subclasses-of-monoid/921>\
**Category:** Announcements\
**Created:** [October 9, 2019, 12:16pm UTC](https://discourse.haskell.org/t/monoid-subclasses-subclasses-of-monoid/921 "2019-10-09T12:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [October 9, 2019, 12:16pm UTC](https://discourse.haskell.org/t/monoid-subclasses-subclasses-of-monoid/921/1 "2019-10-09T12:16:32Z")

</div>

A bit over four years after the 0.1 initial release, [monoid-subclasses-1.0](http://hackage.haskell.org/package/monoid-subclasses-1.0) has been released. There are some slight [backward compatibility breaks](http://hackage.haskell.org/package/monoid-subclasses-1.0/changelog). Most significantly, some of the subclasses of `Monoid` have become subclasses of `Semigroup` instead. There are constraint synonyms in place for the old classes, so most client code should continue to work. I’m planning to deprecate the constraint synonyms with version 1.1.

Among other news, the new monoid subclass [`Monus`](http://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Monus.html) has been introduced, together with its superclass [OverlappingGCDMonoid](http://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Monus.html#t:OverlappingGCDMonoid) that works for non-Abelian monoids.

Have fun!

---

<div class="post-metadata">

**Author:** ![danidiaz](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/danidiaz/32/92_2.png) [@danidiaz](https://discourse.haskell.org/u/danidiaz)\
**Post date:** [October 12, 2019, 9:38am UTC](https://discourse.haskell.org/t/monoid-subclasses-subclasses-of-monoid/921/2 "2019-10-12T09:38:40Z")

</div>

I like how [`FactorialMonoid`](https://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Factorial.html#t:FactorialMonoid) fits with different representations of “packed” data like `Text`, `ByteString` or `Vector`.

For the [`OffsetPositioned`](https://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Instances-Positioned.html#t:OffsetPositioned) and [`LinePositioned`](https://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Instances-Positioned.html#t:LinePositioned) types, `mappend` “forgets” all positional information, doesn’t it? Perhaps it should be mentioned in the documentation.

---

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [October 15, 2019, 2:05pm UTC](https://discourse.haskell.org/t/monoid-subclasses-subclasses-of-monoid/921/3 "2019-10-15T14:05:51Z")

</div>

> [@danidiaz](#):
>
> For the [`OffsetPositioned`](https://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Instances-Positioned.html#t:OffsetPositioned) and [`LinePositioned`](https://hackage.haskell.org/package/monoid-subclasses-1.0/docs/Data-Monoid-Instances-Positioned.html#t:LinePositioned) types, `mappend` “forgets” all positional information, doesn’t it? Perhaps it should be mentioned in the documentation.

On the two types you mention, `mappend` preserves the position of the left argument – unless the left position is at 0 in which case it attempts to preserve the position of the right argument. I guess I should document it that way, thanks for pointing it out.
