Copyright | (C) 2013-2015, University of Twente |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | Unsafe |
Language | Haskell2010 |
Extensions |
|
- newtype Index n = I {}
- eq# :: Index n -> Index n -> Bool
- neq# :: Index n -> Index n -> Bool
- lt# :: Index n -> Index n -> Bool
- ge# :: Index n -> Index n -> Bool
- gt# :: Index n -> Index n -> Bool
- le# :: Index n -> Index n -> Bool
- enumFrom# :: KnownNat n => Index n -> [Index n]
- enumFromThen# :: KnownNat n => Index n -> Index n -> [Index n]
- enumFromTo# :: KnownNat n => Index n -> Index n -> [Index n]
- enumFromThenTo# :: KnownNat n => Index n -> Index n -> Index n -> [Index n]
- maxBound# :: KnownNat n => Index n
- (+#) :: KnownNat n => Index n -> Index n -> Index n
- (-#) :: KnownNat n => Index n -> Index n -> Index n
- (*#) :: KnownNat n => Index n -> Index n -> Index n
- fromInteger# :: KnownNat n => Integer -> Index n
- quot# :: Index n -> Index n -> Index n
- rem# :: Index n -> Index n -> Index n
- mod# :: Index n -> Index n -> Index n
- toInteger# :: Index n -> Integer
Datatypes
Arbitrary-bounded unsigned integer represented by ceil(log_2(n))
bits.
Given an upper bound n
, an Index
n
number has a range of: [0 .. n
-1]
>>>
maxBound :: Index 8
7>>>
minBound :: Index 8
0>>>
1 + 2 :: Index 8
3>>>
2 + 6 :: Index 8
*** Exception: 8 is out of bounds: [0..7]>>>
1 - 3 :: Index 8
*** Exception: -2 is out of bounds: [0..7]>>>
2 * 3 :: Index 8
6>>>
2 * 4 :: Index 8
*** Exception: 8 is out of bounds: [0..7]
I | The constructor, |
KnownNat n => Bounded (Index n) Source | |
KnownNat n => Enum (Index n) Source | The functions: |
Eq (Index n) Source | |
KnownNat n => Integral (Index n) Source | |
KnownNat n => Num (Index n) Source | Operators report an error on overflow and underflow |
Ord (Index n) Source | |
KnownNat n => Real (Index n) Source | |
Show (Index n) Source | |
KnownNat n => Arbitrary (Index n) Source | |
KnownNat n => CoArbitrary (Index n) Source | |
KnownNat n => Default (Index n) Source | |
KnownNat n => Lift (Index n) Source | |
Bundle (Index n) Source | |
type Unbundled' clk (Index n) = Signal' clk (Index n) |
Type classes
Eq
Ord
Enum (not synthesisable)
Bounded
Num
fromInteger# :: KnownNat n => Integer -> Index n Source
Integral
toInteger# :: Index n -> Integer Source