HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulegroups-0.5.3Haskell2010

Data.Group

  • 3 classes
  • 2 values
  • 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
valuegenerated' :: (Eq a, Cyclic a) => [a]
#

Lazily generate all elements of a Cyclic group using its generator.

Note: Fuses, terminates if the underlying group is finite.