monoid-subclasses: Subclasses of Monoid

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.


A hierarchy of subclasses of Monoid together with their instances for all data structures from base, containers, and text packages.

[Skip to ReadMe]


Versions0.1, 0.1.1, 0.1.2, 0.2, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4,, 0.3.5, 0.3.6,,, 0.4,,,,, 0.4.1,,, 0.4.2,, 0.4.3,,, 0.4.4, 0.4.5, 0.4.5, 0.4.6,
Dependenciesbase (>=4.9 && <5), bytestring (>=0.9 && <1.0), containers (>= && <0.6), primes (==0.2.*), text (>=0.11 && <1.3), vector (>=0.9 && <0.13) [details]
Copyright(c) 2013-2018 Mario Blažević
AuthorMario Blažević
MaintainerMario Blažević <>
CategoryData, Algebra, Text
Home page
Bug tracker
Source repositoryhead: git clone
UploadedFri Mar 16 01:40:01 UTC 2018 by MarioBlazevic



Maintainers' corner

For package maintainers and hackage trustees

Readme for monoid-subclasses-0.4.5

[back to package description]


Subclasses of Monoid with a solid theoretical foundation and practical purposes

The monoid-subclasses package has been released on Hackage. The package defines several classes that are richer than monoids but less demanding than groups:

That's the theoretical point of view. From the practical point of view, the main purpose of the monoid-subclasses package is similar to that of ListLike - to provide unifying abstractions for various monoidal data types in Haskell, primarily String, ByteString, and Text. All three types are already instances of the Monoid class. While that abstraction is useful for building sequences of data, it doesn't help with deconstructing them.

That being said, there are two major differences in the goals of ListLike and monoid-subclasses:

The incremental-parser package provides one example of use of monoid-subclasses. Another example is picoparsec, a fork of attoparsec.

A more thorough description of the library can be found in the Haskell Symposium 2013 paper Adding Structure to Monoids