clash-prelude-0.4: CAES Language for Synchronous Hardware - Prelude library
CLaSH.Promoted.Nat
Synopsis
data SNat n Source
Singleton value for a type-level natural number n
n
snat :: KnownNat n => SNat n Source
Singleton value for a type-level natural number
withSNat :: KnownNat n => (SNat n -> a) -> a Source
Supply a function with a singleton natural n according to the context
data UNat where Source
Unary representation of a type-level natural
Constructors
toUNat :: SNat n -> UNat n Source
Convert a singleton natural number to it's unary representation
addUNat :: UNat n -> UNat m -> UNat (n + m) Source
Add two singleton natural numbers
multUNat :: UNat n -> UNat m -> UNat (n * m) Source
Multiply two singleton natural numbers
powUNat :: UNat n -> UNat m -> UNat (n ^ m) Source
Exponential of two singleton natural numbers