/s

A generalized parser combinator super-readable

Primary LanguageHaskellMIT LicenseMIT

s

s is a generalized parser combinator extremely easy to use. The letter s symbolizes simplicity.

This project is heavily inspired by Parsec, but has a completely different goal.
s focuses more on the essentials so that it helps usability and extensibility.

Build

# not uploaded to the hackage yet
$ git clone https://github.com/thyeem/s.git    
$ stack build

# doctest
$ stack test

# generate/open doc
$ stack haddock --open s

Examples

sLISP

See sLISP, which is a pure-functional LISP implementation in Haskell.
s is used in the parsing part of S-expression in sLISP.

CSV parser

See src/Text/S/Example/CSV.hs

JSON parser

See src/Text/S/Example/JSON.hs

Generalized calculator

See src/Text/S/Example/Calc.hs

calculator REPL
>>> import Text.S.Example.Calc (calc)
>>> calc
Choose an Expr Calculators [infixl, infixr, prefix, postfix]: