clash-lib-1.4.7: Clash: a functional hardware description language - As a library
Copyright(C) 2019 Myrtle Software Ltd
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Clash.Core.TermLiteral

Description

Tools to convert a Term into its "real" representation

Synopsis

Documentation

class Typeable a => TermLiteral a Source #

Tools to deal with literals encoded as a Term.

Minimal complete definition

termToData

Instances

Instances details
TermLiteral Bool Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Char Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Int Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Integer Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Natural Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Word Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral String Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Text Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral Term Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral RenderAs Source # 
Instance details

Defined in Clash.Core.TermLiteral

Methods

termToData :: Term -> Either Term RenderAs Source #

TermLiteral a => TermLiteral (Maybe a) Source # 
Instance details

Defined in Clash.Core.TermLiteral

TermLiteral a => TermLiteral (Assertion' a) Source # 
Instance details

Defined in Clash.Core.TermLiteral

Methods

termToData :: Term -> Either Term (Assertion' a) Source #

TermLiteral a => TermLiteral (Property' a) Source # 
Instance details

Defined in Clash.Core.TermLiteral

Methods

termToData :: Term -> Either Term (Property' a) Source #

(TermLiteral a, TermLiteral b) => TermLiteral (a, b) Source # 
Instance details

Defined in Clash.Core.TermLiteral

Methods

termToData :: Term -> Either Term (a, b) Source #

termToData Source #

Arguments

:: (TermLiteral a, HasCallStack) 
=> Term

Term to convert

-> Either Term a

Left indicates a failure, containing the (sub)term that failed to translate. Right indicates a success.

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.

uncheckedTermToData :: TermLiteral a => Term -> a Source #

Same as termToData, but errors hard if it can't translate a given term to data.