https://github.com/thyeem/s
A generalized parser combinator super-readable
https://github.com/thyeem/s
haskell-library parser parser-combinators
Last synced: 11 months ago
JSON representation
A generalized parser combinator super-readable
- Host: GitHub
- URL: https://github.com/thyeem/s
- Owner: thyeem
- License: mit
- Created: 2022-07-09T01:48:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T01:02:45.000Z (about 2 years ago)
- Last Synced: 2025-06-17T16:51:57.956Z (about 1 year ago)
- Topics: haskell-library, parser, parser-combinators
- Language: Haskell
- Homepage:
- Size: 3.93 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# s
`s` is a generalized parser combinator *extremely easy to use*. The letter `s` symbolizes _simplicity_.
This project is heavily inspired by [`Parsec`](https://hackage.haskell.org/package/parsec), but has a completely **different goal**.
`s` focuses more on the essentials so that it helps _usability_ and _extensibility_.
### Build
```bash
# 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`](https://github.com/thyeem/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
```haskell
>>> import Text.S.Example.Calc (calc)
>>> calc
Choose an Expr Calculators [infixl, infixr, prefix, postfix]:
```