pinchot-0.20.0.0: Write grammars, not parsers

Safe HaskellNone
LanguageHaskell2010

Pinchot.SyntaxTree.Optics

Synopsis

Documentation

rulesToOptics Source #

Arguments

:: Lift t 
=> Qualifier

Qualifier for module containing the data types that will get optics

-> Name

Type name for the terminal

-> Seq (Rule t) 
-> Q [Dec] 

Creates optics declarations for a Rule, if optics can be made for the Rule:

Each rule in the sequence of Rule, as well as all ancestors of those Rules, will be handled.

Example: Pinchot.Examples.RulesToOptics.

ruleToOptics Source #

Arguments

:: Lift t 
=> Qualifier

Qualifier for module containing the data type that will get optics

-> Name

Type name for the terminal

-> Rule t 
-> Q [Dec] 

Creates optics declarations for a single Rule, if optics can be made for the Rule:

terminalToOptics Source #

Arguments

:: Lift t 
=> Qualifier

Qualifier for module containing the data type that will get optics

-> Name

Terminal type name

-> String

Rule name

-> Intervals t 
-> Q [Dec] 

Creates a prism for a terminal type. Although a newtype wraps each terminal, do not make a Wrapped or an Iso, because the relationship between the outer type and the type that it wraps typically is not isometric. Thus, use a Prism instead, which captures this relationship properly.

nonTerminalToOptics Source #

Arguments

:: Qualifier

Qualifier for module containing the data type that will get optics

-> String

Rule name

-> NonEmptySeq (Branch t) 
-> [Q Dec] 

Creates prisms for each Branch.

recordsToOptics Source #

Arguments

:: Qualifier

Qualifier for module containing the data type that will get optics

-> String

Rule name

-> Seq (Rule t) 
-> [Q Dec]