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 | None |
Language | Haskell2010 |
Template Haskell utilities for Clash.Core.TermLiteral.
Synopsis
- deriveTermToData :: Name -> Q Exp
- deriveShowsTypePrec :: Name -> Q Dec
- deriveTermLiteral :: Name -> Q [Dec]
- dcName' :: DataCon -> String
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