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

Safe HaskellNone

Language.Syntactic.Interpretation.Render

Synopsis

Documentation

class Render dom whereSource

Render a symbol as concrete syntax. A complete instance must define at least the renderSym method.

Methods

renderSym :: dom sig -> StringSource

Show a symbol as a String

renderArgs :: [String] -> dom sig -> StringSource

Render a symbol given a list of rendered arguments

Instances

Render Semantics 
Render Empty 
Render Condition 
Render Construct 
Render Identity 
Render Literal 
Render Tuple 
Render Select 
Render Let 
Render Lambda 
Render Variable 
Render Node 
Monad m => Render (MONAD m) 
(Render expr1, Render expr2) => Render (:+: expr1 expr2) 
Render dom => Render (:|| dom pred) 
Render dom => Render (:| dom pred) 
Render expr => Render (Decor info expr) 
Render dom => Render (SubConstr1 c dom p) 
Render dom => Render (SubConstr2 c dom pa pb) 

render :: forall dom a. Render dom => ASTF dom a -> StringSource

Render an expression as concrete syntax

class Render dom => StringTree dom whereSource

Convert a symbol to a Tree of strings

Methods

stringTreeSym :: [Tree String] -> dom a -> Tree StringSource

Convert a symbol to a Tree given a list of argument trees

stringTree :: forall dom a. StringTree dom => ASTF dom a -> Tree StringSource

Convert an expression to a Tree of strings

showAST :: StringTree dom => ASTF dom a -> StringSource

Show a syntax tree using ASCII art

drawAST :: StringTree dom => ASTF dom a -> IO ()Source

Print a syntax tree using ASCII art

writeHtmlAST :: StringTree sym => FilePath -> ASTF sym a -> IO ()Source