Module documentation for 0.18.5

semigroups

Haskellers are usually familiar with monoids. A monoid has an appending operation <> or mappend and an identity element mempty. A Semigroup has an append <>, but does not require an mempty element. A Monoid can be made a Semigroup with just instance Semigroup MyMonoid

More formally, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.

Data.Semigroup and Data.List.NonEmpty were added to base as of 4.9.0.0. This package now offers a backwards-compatible API and some tools for deriving semigroups with generics.

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett

Changes

0.18.5 [2018.07.02]

Use a more efficient sconcat for the Semigroup instances for strict and
lazy ByteString.

0.18.4 [2018.01.29]

Backport Semigroup instances for Data.Ord.Down and strict ST, which were
added in base-4.11.

0.18.3

Add Semigroup instance for IO, as well as for Event and Lifetime from
GHC.Event

Add Eq1, Ord1, Read1, and Show1 instances for NonEmpty

Define Generic and Generic1 instances back to GHC 7.2, and expose the
Data.Semigroup.Generic module on GHC 7.2

0.18.2

Depend on the bytestring-builder package to ensure Semigroup instances for bytestring Builder and ShortByteString are always defined

Allow building with binary-0.8.3 and later

0.18.1

Add the missing instance for Data.Binary.Builder.Builder.

0.18.0.1

Added support for base-4.9

0.18

Removed the partial functions words, unwords, lines, unlines

0.17.0.1

Fixed the @since annotations

0.17

Added groupWith, groupAllWith, groupWith1, groupAllWith1

Renamed sortOn to sortWith to match the “Comprehensive comprehensions” paper and TransformListComp extension.

Add Semigroup instances for Alt, Void, Proxy and Tagged

Add Num instances for Min and Max

Removed times1p in favor of stimes.

0.16.2.2

Cleaned up imports to remove warnings on GHC 7.10.

0.16.2.1

Restored the ability to build on GHC < 7.6. (Generic1 deriving was only added in GHC 7.6)