clash-lib-1.7.0: Clash: a functional hardware description language - As a library
Copyright(C) 2019 Myrtle Software Ltd
2021 QBayLogic B.V.
2022 Google Inc
LicenseBSD2 (see the file LICENSE)
MaintainerQBayLogic B.V. <devops@qbaylogic.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Core.TermLiteral.TH

Description

Template Haskell utilities for Clash.Core.TermLiteral.

Synopsis

Documentation

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