Copyright | (C) 2019 Myrtle Software Ltd 2021 QBayLogic B.V. |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | QBayLogic B.V. <devops@qbaylogic.com> |
Safe Haskell | None |
Language | Haskell2010 |
Tools to convert a Term
into its "real" representation
Synopsis
- class Typeable a => TermLiteral a
- termToData :: (TermLiteral a, HasCallStack) => Term -> Either Term a
- termToDataError :: forall a. TermLiteral a => Term -> Either String a
Documentation
class Typeable a => TermLiteral a Source #
Tools to deal with literals encoded as a Term.
Instances
TermLiteral Bool Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Char Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Int Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Integer Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Natural Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Word Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral String Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Text Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral Term Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral RenderAs Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral a => TermLiteral (Maybe a) Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral a => TermLiteral (Assertion' a) Source # | |
Defined in Clash.Core.TermLiteral | |
TermLiteral a => TermLiteral (Property' a) Source # | |
Defined in Clash.Core.TermLiteral | |
(TermLiteral a, TermLiteral b) => TermLiteral (a, b) Source # | |
Defined in Clash.Core.TermLiteral |
:: (TermLiteral a, HasCallStack) | |
=> Term | Term to convert |
-> Either Term a |
|
Convert Term
to the constant it represents. Will return an error if
(one of the subterms) fail to translate.
termToDataError :: forall a. TermLiteral a => Term -> Either String a Source #
Same as termToData
, but returns printable error message if it couldn't
translate a term.