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.
- 1 type
- 1 class
- 29 values
- Cpp
- UndecidableInstances
- MonoLocalBinds
- TypeFamilies
- DataKinds
- DeriveDataTypeable
- AutoDeriveTypeable
- TypeSynonymInstances
- FlexibleContexts
- FlexibleInstances
- KindSignatures
- TypeOperators
- ExplicitNamespaces
- Packagenumtype-dk-0.5.0.3
- Exports41
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceIntegers.hs
Type-Level Integers
1 declarationType-level Arithmetic
10 declarationsEquations
Pred ('Neg10Minus n) = 'Neg10Minus (NatSucc n)Pred 'Neg9 = 'Neg10Minus ZPred 'Neg8 = 'Neg9Pred 'Neg7 = 'Neg8Pred 'Neg6 = 'Neg7Pred 'Neg5 = 'Neg6Pred 'Neg4 = 'Neg5Pred 'Neg3 = 'Neg4Pred 'Neg2 = 'Neg3Pred 'Neg1 = 'Neg2Pred 'Zero = 'Neg1Pred 'Pos1 = 'ZeroPred 'Pos2 = 'Pos1Pred 'Pos3 = 'Pos2Pred 'Pos4 = 'Pos3Pred 'Pos5 = 'Pos4Pred 'Pos6 = 'Pos5Pred 'Pos7 = 'Pos6Pred 'Pos8 = 'Pos7Pred 'Pos9 = 'Pos8Pred ('Pos10Plus Z) = 'Pos9Pred ('Pos10Plus n) = 'Pos10Plus (NatPred n)
Equations
Succ ('Neg10Minus Z) = 'Neg9Succ ('Neg10Minus n) = 'Neg10Minus (NatPred n)Succ 'Neg9 = 'Neg8Succ 'Neg8 = 'Neg7Succ 'Neg7 = 'Neg6Succ 'Neg6 = 'Neg5Succ 'Neg5 = 'Neg4Succ 'Neg4 = 'Neg3Succ 'Neg3 = 'Neg2Succ 'Neg2 = 'Neg1Succ 'Neg1 = 'ZeroSucc 'Zero = 'Pos1Succ 'Pos1 = 'Pos2Succ 'Pos2 = 'Pos3Succ 'Pos3 = 'Pos4Succ 'Pos4 = 'Pos5Succ 'Pos5 = 'Pos6Succ 'Pos6 = 'Pos7Succ 'Pos7 = 'Pos8Succ 'Pos8 = 'Pos9Succ 'Pos9 = 'Pos10Plus ZSucc ('Pos10Plus n) = 'Pos10Plus (NatSucc n)
TypeInt negation.
Equations
Negate ('Neg10Minus n) = 'Pos10Plus nNegate 'Neg9 = 'Pos9Negate 'Neg8 = 'Pos8Negate 'Neg7 = 'Pos7Negate 'Neg6 = 'Pos6Negate 'Neg5 = 'Pos5Negate 'Neg4 = 'Pos4Negate 'Neg3 = 'Pos3Negate 'Neg2 = 'Pos2Negate 'Neg1 = 'Pos1Negate 'Zero = 'ZeroNegate 'Pos1 = 'Neg1Negate 'Pos2 = 'Neg2Negate 'Pos3 = 'Neg3Negate 'Pos4 = 'Neg4Negate 'Pos5 = 'Neg5Negate 'Pos6 = 'Neg6Negate 'Pos7 = 'Neg7Negate 'Pos8 = 'Neg8Negate 'Pos9 = 'Neg9Negate ('Pos10Plus n) = 'Neg10Minus n
TypeInt addition.
Equations
(+) 'Zero i = i(+) i ('Neg10Minus n) = Pred i + Succ ('Neg10Minus n)(+) i 'Neg9 = Pred i + 'Neg8(+) i 'Neg8 = Pred i + 'Neg7(+) i 'Neg7 = Pred i + 'Neg6(+) i 'Neg6 = Pred i + 'Neg5(+) i 'Neg5 = Pred i + 'Neg4(+) i 'Neg4 = Pred i + 'Neg3(+) i 'Neg3 = Pred i + 'Neg2(+) i 'Neg2 = Pred i + 'Neg1(+) i 'Neg1 = Pred i(+) i 'Zero = i(+) i i' = Succ i + Pred i'
TypeInt multiplication.
Equations
(*) 'Zero i = 'Zero(*) i 'Zero = 'Zero(*) i 'Pos1 = i(*) i 'Pos2 = i + i(*) i 'Pos3 = (i + i) + i(*) i 'Pos4 = ((i + i) + i) + i(*) i 'Pos5 = (((i + i) + i) + i) + i(*) i 'Pos6 = ((((i + i) + i) + i) + i) + i(*) i 'Pos7 = (((((i + i) + i) + i) + i) + i) + i(*) i 'Pos8 = ((((((i + i) + i) + i) + i) + i) + i) + i(*) i 'Pos9 = (((((((i + i) + i) + i) + i) + i) + i) + i) + i(*) i ('Pos10Plus n) = i + (i * Pred ('Pos10Plus n))(*) i i' = Negate (i * Negate i')
TypeInt division.
Equations
(/) i 'Pos1 = i(/) i 'Neg1 = Negate i(/) 'Zero ('Neg10Minus n) = 'Zero(/) 'Zero 'Neg9 = 'Zero(/) 'Zero 'Neg8 = 'Zero(/) 'Zero 'Neg7 = 'Zero(/) 'Zero 'Neg6 = 'Zero(/) 'Zero 'Neg5 = 'Zero(/) 'Zero 'Neg4 = 'Zero(/) 'Zero 'Neg3 = 'Zero(/) 'Zero 'Neg2 = 'Zero(/) 'Zero 'Pos2 = 'Zero(/) 'Zero 'Pos3 = 'Zero(/) 'Zero 'Pos4 = 'Zero(/) 'Zero 'Pos5 = 'Zero(/) 'Zero 'Pos6 = 'Zero(/) 'Zero 'Pos7 = 'Zero(/) 'Zero 'Pos8 = 'Zero(/) 'Zero 'Pos9 = 'Zero(/) 'Zero ('Pos10Plus n) = 'Zero(/) 'Neg2 'Neg2 = 'Pos1(/) 'Neg3 'Neg3 = 'Pos1(/) 'Neg4 'Neg4 = 'Pos1(/) 'Neg5 'Neg5 = 'Pos1(/) 'Neg6 'Neg6 = 'Pos1(/) 'Neg7 'Neg7 = 'Pos1(/) 'Neg8 'Neg8 = 'Pos1(/) 'Neg9 'Neg9 = 'Pos1(/) ('Neg10Minus n) ('Neg10Minus n) = 'Pos1(/) 'Neg2 'Pos2 = 'Neg1(/) 'Neg3 'Pos3 = 'Neg1(/) 'Neg4 'Pos4 = 'Neg1(/) 'Neg5 'Pos5 = 'Neg1(/) 'Neg6 'Pos6 = 'Neg1(/) 'Neg7 'Pos7 = 'Neg1(/) 'Neg8 'Pos8 = 'Neg1(/) 'Neg9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(/) 'Pos9 'Pos3 = 'Pos3(/) 'Pos8 'Pos4 = 'Pos2(/) ('Pos10Plus n) i = (('Pos10Plus n - Abs i) / i) + Signum i
TypeInt exponentiation.
Equations
(^) i 'Zero = 'Pos1(^) i 'Pos1 = i(^) i 'Pos2 = i * i(^) i 'Pos3 = (i * i) * i(^) i 'Pos4 = ((i * i) * i) * i(^) i 'Pos5 = (((i * i) * i) * i) * i(^) i 'Pos6 = ((((i * i) * i) * i) * i) * i(^) i 'Pos7 = (((((i * i) * i) * i) * i) * i) * i(^) i 'Pos8 = ((((((i * i) * i) * i) * i) * i) * i) * i(^) i 'Pos9 = (((((((i * i) * i) * i) * i) * i) * i) * i) * i(^) i ('Pos10Plus n) = i * (i ^ Pred ('Pos10Plus n))
Arithmetic on Proxies
10 declarationsConvenience Synonyms for Proxies
19 declarationsConversion from Types to Terms
1 declarationInstances21KnownTypeInt, …
KnownTypeInt 'Neg1Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg2Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg3Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg4Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg5Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg6Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg7Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg8Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Neg9Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos1Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos2Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos3Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos4Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos5Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos6Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos7Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos8Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'Pos9Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt 'ZeroDefined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt (Pred ('Pos10Plus n)) => KnownTypeInt ('Pos10Plus n)Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.IntegersKnownTypeInt (Succ ('Neg10Minus n)) => KnownTypeInt ('Neg10Minus n)Defined in numtype-dk-0.5.0.3 · Numeric.NumType.DK.Integers