HORIZON HASKELLDocslts/ghc-9.14.x6d5fdfd2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 6d5fdfd · 2026-10-12

Modulegroups-0.5.3Haskell2010

Data.Group

Synopsis
  • Packagegroups-0.5.3
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceGroup.hs
classclass Monoid m => Group m where

A Group is a Monoid plus a function, invert, such that:

a <> invert a == mempty
invert a <> a == mempty

Methods

  • invert :: m -> m
  • (~~) :: m -> m -> minfixl 7

    Group subtraction: x ~~ y == x <> invert y

  • pow :: Integral x => m -> x -> m
    pow a n == a <> a <> ... <> a
     (n lots of a)

    If n is negative, the result is inverted.

Instances16Group, …
classclass Group g => Abelian g

An Abelian group is a Group that follows the rule:

a <> b == b <> a
Instances16Abelian, …
classclass Group a => Cyclic a where

A Group G is Cyclic if there exists an element x of G such that for all y in G, there exists an n, such that

y = pow x n

Methods

Instances6Cyclic