@@ -1,15 +1,28 @@
11name: syntax
22version: 0.2.1.0
3−synopsis: Abstract syntax descriptions for parsing and pretty-printing.
4−description: Abstract syntax descriptions for parsing and pretty-printing.
5− Write a single syntax description, get both a parser and a pretty-printer.
6− .
7− Syntax descriptions are based on semi-isomorphisms from @semi-iso@ library.
8− .
9− The library is very young. There are lots of useful combinators that could be written.
10− .
11− See @syntax-example@ for an example, @syntax-attoparsec@ and @syntax-pretty@ for
12− a parser/printer implementation.
3+synopsis: Syntax descriptions for unified parsing and pretty-printing.
4+description:
5+ 'syntax' allows you to write a single syntax description and instantiate is both as a parser and a pretty printer.
6+ .
7+ The interface is based on a custom Functor/Applicative/Monad hierarchy, provided by the 'semi-iso' package. You fmap using
8+ a semi-isomorphism instead of function. A semi-isomorphism is a isomorphism that can fail in both directions, with slightly
9+ weakened laws. It is worth to note that @Iso@s and @Prism@s from 'lens' are valid semi-isomorphisms :)
10+ .
11+ Once you write a description you can, for example turn it into an Attoparsec parser.
12+ .
13+ See @syntax-example@ for an example, 'syntax-attoparsec' and 'syntax-pretty' for a parser/printer implementation.
14+ .
15+ The library was inspired by:
16+ .
17+ * Rendel, Tillmann, and Klaus Ostermann. "Invertible syntax descriptions: unifying parsing and pretty printing." ACM Sigplan Notices. Vol. 45. No. 11. ACM, 2010.
18+ .
19+ TODO:
20+ .
21+ * a printer library based on Text/ByteString builders (wrapping 'pretty' is inefficient and doesn't use any features of it),
22+ * try to implement indentation and Haskell layout rule,
23+ * combinators for binary data formats, vectors,
24+ * implementation of do notation for SemiIsoMonad with QuasiQuoters.
25+
1326license: MIT
1427license-file: LICENSE
1528author: Paweł Nowak