New description.

This commit is contained in:
Paweł Nowak 2014-11-24 16:39:50 +01:00
parent 49f4ec91cd
commit 759a20e2cd

View File

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