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

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulenatural-arithmetic-0.2.4.0Haskell2010

Arithmetic.Types

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

A value-level representation of a natural number n.

Instances1Show
  • Show (Nat n)Defined in natural-arithmetic-0.2.4.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.4.0 · Arithmetic.Types
  • Ord (Fin n)Defined in natural-arithmetic-0.2.4.0 · Arithmetic.Types
  • Show (Fin n)Defined in natural-arithmetic-0.2.4.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

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

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

Either Fin

3 declarations
newtypenewtype EitherFin# (a :: Nat) (b :: Nat) where
#

Either a Fin# bounded by the left natural or one bounded by the right natural.

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.4.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.4.0 · Arithmetic.Unsafe
newtypenewtype (:=:#) (a :: Nat) (b :: Nat) where
#