Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data PosNat
- data Sign
- data LiftedInt
- type family LIntSucc (k :: LiftedInt) :: LiftedInt
- type family LIntPred (k :: LiftedInt) :: LiftedInt
- type family LIntInvert (k :: LiftedInt) :: LiftedInt
- type family LIntPlus (k :: LiftedInt) (l :: LiftedInt) :: LiftedInt
- type family LIntMinus (k :: LiftedInt) (l :: LiftedInt) :: LiftedInt
- posNatVal :: forall n. KnownPosNat n => Proxy n -> Integer
- liftedIntVal :: forall i. KnownInt i => Proxy i -> Integer
- class KnownPosNat n
- class KnownInt n
Documentation
Model positive natural numbers.
Model for type level integers: they are either zero or a positive natural number together with a sign.
type family LIntSucc (k :: LiftedInt) :: LiftedInt Source #
Computes the successor for a type level integer.
type family LIntPred (k :: LiftedInt) :: LiftedInt Source #
Computes the predecessor for a type level integer.
type family LIntInvert (k :: LiftedInt) :: LiftedInt Source #
Implement additive inversion for type level integers.
type LIntInvert LIntZero Source # | |
type LIntInvert (LInt Minus n) Source # | |
type LIntInvert (LInt Plus n) Source # | |
type family LIntPlus (k :: LiftedInt) (l :: LiftedInt) :: LiftedInt Source #
Implement addition for type level integers.
type family LIntMinus (k :: LiftedInt) (l :: LiftedInt) :: LiftedInt Source #
Implement subtraction for type level integers.
class KnownPosNat n Source #
posNatSing
KnownPosNat PosNatOne Source # | |
KnownPosNat n => KnownPosNat (S n) Source # | |