clash-lib-1.8.1: Clash: a functional hardware description language - As a library

Copyright | (C) 2019 Myrtle Software Ltd 2021 QBayLogic B.V. 2022 Google Inc
License | BSD2 (see the file LICENSE)
Maintainer | QBayLogic B.V. <devops@qbaylogic.com>
Safe Haskell | Safe-Inferred
Language | Haskell2010

Clash.Core.TermLiteral.TH

Description

Template Haskell utilities for Clash.Core.TermLiteral.

Synopsis

- deriveTermToData :: Name -> Q Exp
- deriveShowsTypePrec :: Name -> Q Dec
- deriveTermLiteral :: Name -> Q [Dec]
- dcName' :: DataCon -> String

# Documentation

deriveTermToData :: Name -> Q Exp Source #

deriveShowsTypePrec :: Name -> Q Dec Source #

For `Maybe`, constructs:

    showsTypePrec n _
      = let
          showSpace = showChar ' '
          precCalls = [showsTypePrec 11 (Proxy @a)]
          interspersedPrecCalls = intersperse showSpace precCalls
          showType = foldl (.) (showString "Maybe") (showSpace : interspersedPrecCalls)
        in
          showParen (n > 10) showType

deriveTermLiteral :: Name -> Q [Dec] Source #

Derive a `TermLiteral` instance for given type

dcName' :: DataCon -> String Source #