The sexp package

[Tags: gpl, library, program]

See the README.md file and the homepage for details.


[Skip to ReadMe]

Properties

Versions0.5, 0.6, 0.7
Change logNone available
Dependenciesattoparsec, base (==4.*), bytestring, cmdargs, mtl, syb [details]
LicenseGPL-3
AuthorAlexandru Scvortov <scvalex@gmail.com>
Maintainerscvalex@gmail.com
Stabilityexperimental
CategoryLanguage, Parsing
Home pagehttps://github.com/scvalex/sexp
Source repositoryhead: git clone https://github.com/scvalex/sexp.git
Executablessexp
UploadedTue Feb 12 18:43:53 UTC 2013 by AlexandruScvortov
DistributionsNixOS:0.7
Downloads727 total (44 in last 30 days)
Votes
0 []
StatusDocs uploaded by user
Build status unknown [no reports yet]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for sexp-0.5

sexp

S-Expression parsing/printing made fun and easy

What

sexp provides an S-expression data-type, and printers and parsers that work on all data-types that have Typeable and Data instances.

λ > import Language.Sexp

λ > data MyType = Foo { unFoo :: Int } deriving ( Data, Show, Typeable )

λ > instance Sexpable MyType

λ > toSexp (Foo 23)
List [Atom "Foo",List [Atom "unFoo",Atom "23"]]

λ > printMach (toSexp (Foo 23))
"(Foo (unFoo 23))"

λ > parseExn (printMach (toSexp (Foo 23)))
[List [Atom "Foo",List [Atom "unFoo",Atom "23"]]]

λ > fromSexp (head (parseExn (printMach (toSexp (Foo 23))))) :: Maybe MyType
Just (Foo {unFoo = 23})