HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulenumtype-dk-0.5.0.3Haskell98

Numeric.NumType.DK.Integers

Summary

Type-level integers for GHC 7.8+.

We provide type level arithmetic operations. We also provide term-level arithmetic operations on proxys, and conversion from the type level to the term level.

Planned Obsolesence

We commit this package to hackage in sure and certain hope of the coming of glorious GHC integer type literals, when the sea shall give up her dead, and this package shall be rendered unto obsolescence.

  • Cpp
  • UndecidableInstances
  • MonoLocalBinds
  • TypeFamilies
  • DataKinds
  • DeriveDataTypeable
  • AutoDeriveTypeable
  • TypeSynonymInstances
  • FlexibleContexts
  • FlexibleInstances
  • KindSignatures
  • TypeOperators
  • ExplicitNamespaces
Contents
  1. Type-Level Integers
  2. Type-level Arithmetic
  3. Arithmetic on Proxies
  4. Convenience Synonyms for Proxies
  5. Conversion from Types to Terms
Synopsis

Type-Level Integers

Type-level Arithmetic

familytype family Pred (i :: TypeInt) :: TypeInt where
#
familytype family Succ (i :: TypeInt) :: TypeInt where
#
familytype family Negate (i :: TypeInt) :: TypeInt where
familytype family (*) (i :: TypeInt) (i' :: TypeInt) :: TypeInt where

TypeInt multiplication.

Equations

familytype family (/) (i :: TypeInt) (i' :: TypeInt) :: TypeInt where

TypeInt division.

Equations

familytype family (^) (i :: TypeInt) (i' :: TypeInt) :: TypeInt where

TypeInt exponentiation.

Equations

Arithmetic on Proxies

Convenience Synonyms for Proxies

Conversion from Types to Terms

classclass KnownTypeInt (i :: TypeInt) where

Conversion to a Num.

Methods

Instances21KnownTypeInt, …