HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

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, Additive, Subtractive, …
newtypenewtype Zn (n :: Nat)
#

A type level bounded natural

Instances20Eq, Num, Ord, Show, Additive, Subtractive, …
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