clash-prelude-0.6.0.1: CAES Language for Synchronous Hardware - Prelude library

Safe HaskellNone
LanguageHaskell2010

CLaSH.Promoted.Nat

Synopsis

Documentation

data SNat n Source

Singleton value for a type-level natural number n

Constructors

KnownNat n => SNat (Proxy n) 

Instances

Show (SNat n) 

snat :: KnownNat n => SNat n Source

Create a singleton literal 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 :: Nat -> * where Source

Unary representation of a type-level natural

NB: Not synthesisable

Constructors

UZero :: UNat 0 
USucc :: UNat n -> UNat (n + 1) 

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

multUNat :: UNat n -> UNat m -> UNat (n * m) Source

Multiply two singleton natural numbers

NB: Not synthesisable

powUNat :: UNat n -> UNat m -> UNat (n ^ m) Source

Exponential of two singleton natural numbers

NB: Not synthesisable