thyeem / s

A generalized parser combinator super-readable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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]: 

About

A generalized parser combinator super-readable

License:MIT License


Languages

Language:Haskell 100.0%