on master help sign in
Update docs.
d537ee1Paweł Nowak
Data/Syntax.hs+7−4
@@ -60,14 +60,17 @@ packed = iso otoList fromList
60-- > atom = _Var /$/ name
60-- > atom = _Var /$/ name
61-- > /|/ parens expr
61-- > /|/ parens expr
62-- >
62-- >
63+-- > --| Parses a list of applications.
64+-- > apps :: Syntax syn Text => syn AST
65+-- > apps = bifoldl1 (attemptAp_ _App) /$/ S.sepBy1 atom S.spaces1
66+-- >
63-- > -- | An expression of our lambda calculus.
67-- > -- | An expression of our lambda calculus.
64-- > expr :: Syntax syn Text => syn AST
68-- > expr :: Syntax syn Text => syn AST
65−-- > expr = _App /$/ atom /* S.spaces1 /*/ atom
66−-- > /|/ _Abs /$/ S.char '\\' /* S.spaces_
69+-- > expr = _Abs /$/ S.char '\\' /* S.spaces_
67-- > */ name /* S.spaces
70-- > */ name /* S.spaces
68-- > /* S.string "->" /* S.spaces
71-- > /* S.string "->" /* S.spaces
69−-- > /*/ expr
72+-- > /*/ expr
70−-- > /|/ atom
73+-- > /|/ apps
71--
74--
72-- Methods of this class try to mimic "Data.Attoparsec.Text" interface.
75-- Methods of this class try to mimic "Data.Attoparsec.Text" interface.
73class ( SemiIsoAlternative syn
76class ( SemiIsoAlternative syn
syntax.cabal+4−2
@@ -1,13 +1,15 @@
1name: syntax
1name: syntax
2version: 0.1.1.0
2version: 0.1.1.0
3synopsis: Abstract syntax descriptions for parsing and pretty-printing.
3synopsis: Abstract syntax descriptions for parsing and pretty-printing.
4+description: Abstract syntax descriptions for parsing and pretty-printing.
4−description: Write single syntax description, get both parser and pretty-printer.
5+ Write a single syntax description, get both a parser and a pretty-printer.
5 .
6 .
6 Syntax descriptions are based on semi-isomorphisms from @semi-iso@ library.
7 Syntax descriptions are based on semi-isomorphisms from @semi-iso@ library.
7 .
8 .
8 The library is very young. There are lots of useful combinators that could be written.
9 The library is very young. There are lots of useful combinators that could be written.
9 .
10 .
10− See @syntax-example@ for an example.
11+ See @syntax-example@ for an example, @syntax-attoparsec@ and @syntax-pretty@ for
12+ a parser/printer implementation.
11license: MIT
13license: MIT
12license-file: LICENSE
14license-file: LICENSE
13author: Paweł Nowak
15author: Paweł Nowak