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

Modulebasement-0.0.16Haskell2010

Basement.Bounded

Types to represent ℤ/nℤ.

ℤ/nℤ is a finite field and is defined as the set of natural number: {0, 1, ..., n − 1}.

  • 2 types
  • 6 values
  • Packagebasement-0.0.16
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceBounded.hs
newtypenewtype Zn64 (n :: Nat)
#

A type level bounded natural backed by a Word64

Instances20Eq, Num, Ord, Show, Integral, Additive, …
newtypenewtype Zn (n :: Nat)
#

A type level bounded natural

Instances20Eq, Num, Ord, Show, Integral, Additive, …
valuezn :: KnownNat n => Natural -> Zn n
#

Create an element of ℤ/nℤ from a Natural.

If the value is greater than n, then the value is normalized by using the integer modulus n