HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.Data.Group

  • 3 classes
  • 2 values
  • Packagerebase-1.21.2
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • 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 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
classclass Group g => Abelian g
#

An Abelian group is a Group that follows the rule:

a <> b == b <> a
Instances16Abelian, …
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.