syntax-1.0.0.0: Reversible parsing and pretty-printing.

Copyright(c) Paweł Nowak
LicenseMIT
MaintainerPaweł Nowak <pawel834@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.Syntax.Indent

Description

Provides a very simple indentation as a category transformer.

Synopsis

Documentation

data Indent cat a b Source

Adds indentation to a syntax description.

Instances

CatTrans Indent 
Category * cat => Category * (Indent cat) 
SIArrow cat => SIArrow (Indent cat) 
Products cat => Products (Indent cat) 
Coproducts cat => Coproducts (Indent cat) 
CatPlus cat => CatPlus (Indent cat) 
Syntax syn => Syntax (Indent syn) 
SyntaxChar syn => SyntaxChar (Indent syn) 
type Seq (Indent syn) = Seq syn 

runIndent :: Indent cat a b -> cat () () -> cat a b Source

runIndent m tab runs the Indent transformer using tab once for each level of indentation.

breakLine :: SyntaxChar syn => Indent syn () () Source

Inserts a new line and correct indentation, but does not require any formatting when parsing (it just skips all white space).

indented :: Indent cat a b -> Indent cat a b Source

Increases the indentation level of its argument by one.