Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (eir@cis.upenn.edu) |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module defines a datatype and operations to represent type-level
integers. Though it's defined as part of the units package, it may be
useful beyond dimensional analysis. If you have a compelling non-units
use of this package, please let me (Richard, eir
at cis.upenn.edu
)
know.
- data Z
- type SZ z = Sing z
- type family Equals_1627415457 a b :: Bool
- zToInt :: Z -> Int
- type family Succ z :: Z
- type family Pred z :: Z
- type family a #+ b :: Z
- type family a #- b :: Z
- type family a #* b :: Z
- type family NegZ z :: Z
- type family a #/ b :: Z
- type family ZDiv counter n z :: Z
- type family a < b :: Bool
- type One = S Zero
- type Two = S One
- type Three = S Two
- type Four = S Three
- type Five = S Four
- type MOne = P Zero
- type MTwo = P MOne
- type MThree = P MTwo
- type MFour = P MThree
- type MFive = P MFour
- pZero :: Sing Z Zero
- pOne :: Sing Z (S Zero)
- pTwo :: Sing Z (S (S Zero))
- pThree :: Sing Z (S (S (S Zero)))
- pFour :: Sing Z (S (S (S (S Zero))))
- pFive :: Sing Z (S (S (S (S (S Zero)))))
- pMOne :: Sing Z (P Zero)
- pMTwo :: Sing Z (P (P Zero))
- pMThree :: Sing Z (P (P (P Zero)))
- pMFour :: Sing Z (P (P (P (P Zero))))
- pMFive :: Sing Z (P (P (P (P (P Zero)))))
- pSucc :: Sing z -> Sing (Succ z)
- pPred :: Sing z -> Sing (Pred z)
- szToInt :: Sing (z :: Z) -> Int
Documentation
The datatype for type-level integers.
type family Equals_1627415457 a b :: Bool Source
Equals_1627415457 Zero Zero = True | |
Equals_1627415457 (S a) (S b) = (==) a b | |
Equals_1627415457 (P a) (P b) = (==) a b | |
Equals_1627415457 (a :: Z) (b :: Z) = False |
This is the singleton value representing Zero
at the term level and
at the type level, simultaneously. Used for raising units to powers.