Copyright | (C) 2013-2015, University of Twente |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
- data SNat n = KnownNat n => SNat (Proxy n)
- snat :: KnownNat n => SNat n
- withSNat :: KnownNat n => (SNat n -> a) -> a
- snatToInteger :: SNat n -> Integer
- data UNat :: Nat -> * where
- toUNat :: SNat n -> UNat n
- addUNat :: UNat n -> UNat m -> UNat (n + m)
- multUNat :: UNat n -> UNat m -> UNat (n * m)
- powUNat :: UNat n -> UNat m -> UNat (n ^ m)
Documentation
Singleton value for a type-level natural number n
- CLaSH.Promoted.Nat.Literals contains a list of predefined
SNat
literals - CLaSH.Promoted.Nat.TH has functions to easily create large ranges of new
SNat
literals
withSNat :: KnownNat n => (SNat n -> a) -> a Source
Supply a function with a singleton natural n
according to the context
snatToInteger :: SNat n -> Integer Source
toUNat :: SNat n -> UNat n Source
Convert a singleton natural number to its unary representation
NB: Not synthesisable
addUNat :: UNat n -> UNat m -> UNat (n + m) Source
Add two singleton natural numbers
NB: Not synthesisable