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 | Safe-Inferred |
Language | Haskell2010 |
Clash.Core.TermLiteral
Description
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.
Minimal complete definition
Instances
Arguments
:: (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.