Copyright | (c) 2018 Iris Ward |
---|---|
License | BSD3 |
Maintainer | aditu.venyhandottir@gmail.com |
Stability | experimental |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Type level integers can be used in the same way as type level naturals
from GHC.TypeLits, for example 3
. However, a minus sign is not
recognised in this context, so a negative type-level integer is instead
written as
.Neg
n
Construction
(Kind) An integer that may be negative.
Linking type and value level
class KnownInt (n :: k) Source #
This class gives the (value-level) integer associated with a type-level
integer. There are instances of this class for every concrete natural:
0, 1, 2, etc. There are also instances of this class for every negated
natural, such as
.Neg
1
intSing
intVal :: forall n proxy. KnownInt n => proxy n -> Integer Source #
Get the value associated with a type-level integer
This type represents unknown type-level integers.
Since: typenums-0.1.1
someIntVal :: Integer -> SomeInt Source #
Convert an integer into an unknown type-level integer.
Since: typenums-0.1.1