syntactic-0.8: Generic abstract syntax, and utilities for embedded languages

Safe HaskellNone

Language.Syntactic.Interpretation.Semantics

Description

Default implementations of some interpretation functions

Synopsis

Documentation

data Semantics a whereSource

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.

Constructors

Sem :: Signature a => String -> Denotation a -> Semantics a 

class Semantic expr whereSource

Class of expressions that can be treated as constructs

Methods

semantics :: expr a -> Semantics aSource

Instances

exprEqSem :: Semantic expr => expr a -> expr b -> BoolSource

Default implementation of exprEq

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