Safe Haskell | None |
---|
Default implementations of some interpretation functions
- data Semantics a where
- Sem :: {
- semanticName :: String
- semanticEval :: Denotation a
- Sem :: {
- class Semantic expr where
- equalDefault :: Semantic expr => expr a -> expr b -> Bool
- exprHashDefault :: Semantic expr => expr a -> Hash
- renderSymDefault :: Semantic expr => expr a -> String
- renderArgsDefault :: Semantic expr => [String] -> expr a -> String
- evaluateDefault :: Semantic expr => expr a -> Denotation a
- semanticInstances :: Name -> DecsQ
Documentation
A representation of a syntactic construct as a String
and an evaluation
function. It is not meant to be used as a syntactic symbol in an AST
. Its
only purpose is to provide the default implementations of functions like
equal
via the Semantic
class.
Sem :: String -> Denotation a -> Semantics a | |
|
equalDefault :: Semantic expr => expr a -> expr b -> BoolSource
Default implementation of equal
exprHashDefault :: Semantic expr => expr a -> HashSource
Default implementation of exprHash
renderSymDefault :: Semantic expr => expr a -> StringSource
Default implementation of renderSym
renderArgsDefault :: Semantic expr => [String] -> expr a -> StringSource
Default implementation of renderArgs
evaluateDefault :: Semantic expr => expr a -> Denotation aSource
Default implementation of evaluate
semanticInstances :: Name -> DecsQSource
Derive instances for Semantic
related classes
(Equality
, Render
, StringTree
, Eval
)