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

Modulenatural-arithmetic-0.2.1.0Haskell2010

Arithmetic.Types

  • 14 types
newtypenewtype Nat (n :: Nat)
#

A value-level representation of a natural number n.

Instances1Show
  • Show (Nat n)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Unsafe
newtypenewtype Nat# (a :: Nat) where
#

Unboxed variant of Nat.

datadata Difference (a :: Nat) (b :: Nat) where
#

Proof that the first argument can be expressed as the sum of the second argument and some other natural number.

Constructors

datadata Fin (a :: Nat) where
#

A finite set of n elements. 'Fin n = { 0 .. n - 1 }'

Constructors

Instances3Eq, Ord, Show
  • Eq (Fin n)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Types
  • Ord (Fin n)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Types
  • Show (Fin n)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Types
newtypenewtype Fin# (a :: Nat) where
#

Finite numbers without the overhead of carrying around a proof.

newtypenewtype Fin32# (a :: Nat) where
#

Variant of Fin# that only allows 32-bit integers.

Maybe Fin

3 declarations
newtypenewtype MaybeFin# (a :: Nat) where
#

Either a Fin# or Nothing. Internally, this uses negative one to mean Nothing.

Infix Operators

6 declarations
datadata (<) (a :: Nat) (b :: Nat) where
#

Proof that the first argument is strictly less than the second argument.

datadata (<=) (a :: Nat) (b :: Nat) where
#

Proof that the first argument is less than or equal to the second argument.

Instances1Category
  • Category (<=)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Unsafe
newtypenewtype (<#) (a :: Nat) (b :: Nat) where
#
newtypenewtype (<=#) (a :: Nat) (b :: Nat) where
#
datadata (:=:) (a :: Nat) (b :: Nat) where
#

Proof that the first argument is equal to the second argument.

Instances1Category
  • Category (:=:)Defined in natural-arithmetic-0.2.1.0 · Arithmetic.Unsafe
newtypenewtype (:=:#) (a :: Nat) (b :: Nat) where
#