commutative-semigroups

Commutative semigroups

Version on this page:0.1.0.0@rev:3
LTS Haskell 22.39:0.1.1.0
Stackage Nightly 2024-10-31:0.2.0.1
Latest on Hackage:0.2.0.1

See all snapshots commutative-semigroups appears in

BSD-3-Clause licensed by Nathan "Taneb" van Doorn
Maintained by [email protected]
This version can be pinned in stack with:commutative-semigroups-0.1.0.0@sha256:dad85d15bac29720ba7f6b1bfdd2bec2914eb553f6a224dc9d8b3d080e1f7fbc,1151

Module documentation for 0.1.0.0

Depends on 2 packages(full list with versions):
Used by 1 package in nightly-2022-12-12(full list with versions):

Commutative Semigroup

Haskell Hackage Hackage CI BSD3 License

A commutative semigroup is a semigroup where the order of arguments to mappend does not matter.

class Semigroup g => Commutative g

Changes

Revision history for commutative-semigroups

0.1.0.0 – 2022-06-12

  • Commutative (Product a) now requires CommutativeProduct a. CommutativeProduct is a new class to indicate (*) from Num is commutative, which is not required by Num. (Example: multiplication on quaternions is non-commutative, and the Quaternion a type from the linear package has a valid instance RealFloat a => Num (Quaternion a).)

    Remark: There is also no canonical subclass class in the Num hierarchy which implies commutative (*), as both Integral and Floating instances work here:

    • Integral instances are customarily Euclidean Domains, which are commutative rings with extra conditions.

    • Floating instances customarily expect (+), (*), and exp to form an exponential field, which is also a commutative ring with extra conditions.

0.0.2.0 – 2022-03-26

  • Add instance Ord a => Commutative (Set a)
  • Add instance Commutative IntSet

0.0.1.0 – 2021-01-28

  • Add instance for Maybe.

0.0.0.0 – 2021-01-06

Initial version, created from groups package.