Safe Haskell | None |
---|
Default implementations of some interpretation functions
- data Semantics a where
- Sem :: Signature a => {
- semanticName :: String
- semanticEval :: Denotation a
- Sem :: Signature a => {
- class Semantic expr where
- exprEqSem :: Semantic expr => expr a -> expr b -> Bool
- exprHashSem :: Semantic expr => expr a -> Hash
- renderPartSem :: Semantic expr => [String] -> expr a -> String
- evaluateSem :: Semantic expr => expr a -> a
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
exprEq
via the Semantic
class.
Sem :: Signature a => String -> Denotation a -> Semantics a | |
|
exprHashSem :: Semantic expr => expr a -> HashSource
Default implementation of exprHash
renderPartSem :: Semantic expr => [String] -> expr a -> StringSource
Default implementation of renderPart
evaluateSem :: Semantic expr => expr a -> aSource
Default implementation of evaluate