syntactic-1.4: 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 where

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.

Constructors

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

class Semantic expr where

Class of expressions that can be treated as constructs

Methods

semantics :: expr a -> Semantics a

equalDefault :: Semantic expr => expr a -> expr b -> Bool

Default implementation of equal

exprHashDefault :: Semantic expr => expr a -> Hash

Default implementation of exprHash

renderArgsDefault :: Semantic expr => [String] -> expr a -> String

Default implementation of renderArgs

evaluateDefault :: Semantic expr => expr a -> Denotation a

Default implementation of evaluate