clash-prelude-1.8.4: Clash: a functional hardware description language - Prelude library

Copyright | (C) 2013-2016 University of Twente
License | BSD2 (see the file LICENSE)
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com>
Safe Haskell | Trustworthy
Language | Haskell2010

Extensions

- TemplateHaskell
- TemplateHaskellQuotes
- ScopedTypeVariables
- BangPatterns
- ViewPatterns
- DataKinds
- InstanceSigs
- StandaloneDeriving
- DeriveDataTypeable
- DeriveFunctor
- DeriveTraversable
- DeriveFoldable
- DeriveGeneric
- DefaultSignatures
- DeriveLift
- DerivingStrategies
- MagicHash
- KindSignatures
- PostfixOperators
- TupleSections
- TypeOperators
- ExplicitNamespaces
- ExplicitForAll
- BinaryLiterals
- TypeApplications

Clash.Promoted.Nat.TH

Contents

- Declare a single `d<N>` literal
- Declare ranges of `d<N>` literals

Description

Synopsis

- decLiteralD :: Integer -> Q [Dec]
- decLiteralsD :: Integer -> Integer -> Q [Dec]

# Declare a single `d<N>` literal

decLiteralD :: Integer -> Q [Dec] Source #

Create an `SNat` literal

    $(decLiteralD 1111)

    >>> :t d1111
    d1111 :: SNat 1111

# Declare ranges of `d<N>` literals

decLiteralsD :: Integer -> Integer -> Q [Dec] Source #

Create a range of `SNat` literals

    $(decLiteralsD 1200 1202)

    >>> :t d1200
    d1200 :: SNat 1200
    >>> :t d1201
    d1201 :: SNat 1201
    >>> :t d1202
    d1202 :: SNat 1202