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

Safe HaskellNone
LanguageHaskell2010

Language.Syntactic.Interpretation.Render

Contents

Synopsis

Documentation

class Render dom where Source #

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

Methods

renderSym :: dom sig -> String Source #

Show a symbol as a String

renderArgs :: [String] -> dom sig -> String Source #

Render a symbol given a list of rendered arguments

renderSym :: Semantic dom => dom sig -> String Source #

Show a symbol as a String

Instances
Render Semantics Source # 
Instance details

Defined in Language.Syntactic.Interpretation.Render

Render Empty Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

renderSym :: Empty sig -> String Source #

renderArgs :: [String] -> Empty sig -> String Source #

Render Tuple Source # 
Instance details

Defined in Language.Syntactic.Constructs.Tuple

Methods

renderSym :: Tuple sig -> String Source #

renderArgs :: [String] -> Tuple sig -> String Source #

Render Select Source # 
Instance details

Defined in Language.Syntactic.Constructs.Tuple

Render Literal Source # 
Instance details

Defined in Language.Syntactic.Constructs.Literal

Render Identity Source # 
Instance details

Defined in Language.Syntactic.Constructs.Identity

Render Construct Source # 
Instance details

Defined in Language.Syntactic.Constructs.Construct

Render Condition Source # 
Instance details

Defined in Language.Syntactic.Constructs.Condition

Render Let Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

Methods

renderSym :: Let sig -> String Source #

renderArgs :: [String] -> Let sig -> String Source #

Render Lambda Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

Render Variable Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

Render Node Source # 
Instance details

Defined in Language.Syntactic.Sharing.Graph

Methods

renderSym :: Node sig -> String Source #

renderArgs :: [String] -> Node sig -> String Source #

Monad m => Render (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

Methods

renderSym :: MONAD m sig -> String Source #

renderArgs :: [String] -> MONAD m sig -> String Source #

(Render expr1, Render expr2) => Render (expr1 :+: expr2) Source # 
Instance details

Defined in Language.Syntactic.Interpretation.Render

Methods

renderSym :: (expr1 :+: expr2) sig -> String Source #

renderArgs :: [String] -> (expr1 :+: expr2) sig -> String Source #

Render dom => Render (dom :|| pred) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

renderSym :: (dom :|| pred) sig -> String Source #

renderArgs :: [String] -> (dom :|| pred) sig -> String Source #

Render dom => Render (dom :| pred) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

renderSym :: (dom :| pred) sig -> String Source #

renderArgs :: [String] -> (dom :| pred) sig -> String Source #

Render expr => Render (Decor info expr) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Decoration

Methods

renderSym :: Decor info expr sig -> String Source #

renderArgs :: [String] -> Decor info expr sig -> String Source #

Render dom => Render (SubConstr1 c dom p) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

renderSym :: SubConstr1 c dom p sig -> String Source #

renderArgs :: [String] -> SubConstr1 c dom p sig -> String Source #

Render dom => Render (SubConstr2 c dom pa pb) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

renderSym :: SubConstr2 c dom pa pb sig -> String Source #

renderArgs :: [String] -> SubConstr2 c dom pa pb sig -> String Source #

renderSymDefault :: Semantic expr => expr a -> String Source #

Default implementation of renderSym

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

Default implementation of renderArgs

render :: forall dom a. Render dom => ASTF dom a -> String Source #

Render an expression as concrete syntax

class Render dom => StringTree dom where Source #

Convert a symbol to a Tree of strings

Methods

stringTreeSym :: [Tree String] -> dom a -> Tree String Source #

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

Instances
StringTree Empty Source # 
Instance details

Defined in Language.Syntactic.Constraint

StringTree Tuple Source # 
Instance details

Defined in Language.Syntactic.Constructs.Tuple

StringTree Select Source # 
Instance details

Defined in Language.Syntactic.Constructs.Tuple

StringTree Literal Source # 
Instance details

Defined in Language.Syntactic.Constructs.Literal

StringTree Identity Source # 
Instance details

Defined in Language.Syntactic.Constructs.Identity

StringTree Construct Source # 
Instance details

Defined in Language.Syntactic.Constructs.Construct

StringTree Condition Source # 
Instance details

Defined in Language.Syntactic.Constructs.Condition

StringTree Let Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

StringTree Lambda Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

StringTree Variable Source # 
Instance details

Defined in Language.Syntactic.Constructs.Binding

StringTree Node Source # 
Instance details

Defined in Language.Syntactic.Sharing.Graph

Monad m => StringTree (MONAD m) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Monad

(StringTree dom1, StringTree dom2) => StringTree (dom1 :+: dom2) Source # 
Instance details

Defined in Language.Syntactic.Interpretation.Render

Methods

stringTreeSym :: [Tree String] -> (dom1 :+: dom2) a -> Tree String Source #

StringTree dom => StringTree (dom :|| pred) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

stringTreeSym :: [Tree String] -> (dom :|| pred) a -> Tree String Source #

StringTree dom => StringTree (dom :| pred) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

stringTreeSym :: [Tree String] -> (dom :| pred) a -> Tree String Source #

StringTree expr => StringTree (Decor info expr) Source # 
Instance details

Defined in Language.Syntactic.Constructs.Decoration

Methods

stringTreeSym :: [Tree String] -> Decor info expr a -> Tree String Source #

StringTree dom => StringTree (SubConstr1 c dom p) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

stringTreeSym :: [Tree String] -> SubConstr1 c dom p a -> Tree String Source #

StringTree dom => StringTree (SubConstr2 c dom pa pb) Source # 
Instance details

Defined in Language.Syntactic.Constraint

Methods

stringTreeSym :: [Tree String] -> SubConstr2 c dom pa pb a -> Tree String Source #

stringTree :: forall dom a. StringTree dom => ASTF dom a -> Tree String Source #

Convert an expression to a Tree of strings

showAST :: StringTree dom => ASTF dom a -> String Source #

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 #

Orphan instances

Render dom => Show (ASTF dom a) Source # 
Instance details

Methods

showsPrec :: Int -> ASTF dom a -> ShowS #

show :: ASTF dom a -> String #

showList :: [ASTF dom a] -> ShowS #