HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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