26 lines
620 B
Markdown
26 lines
620 B
Markdown
|
|
# 12-haskell-parser-combinators
|
||
|
|
|
||
|
|
This example shows intermediate Haskell parsing with Megaparsec and parser combinators.
|
||
|
|
|
||
|
|
It includes:
|
||
|
|
|
||
|
|
- a small command language for deploy instructions,
|
||
|
|
- parser combinators for sequencing, choice, repetition, and end-of-input,
|
||
|
|
- a CLI that parses and renders the parsed command, and
|
||
|
|
- a test suite run by `nix flake check`.
|
||
|
|
|
||
|
|
Useful commands:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
nix develop
|
||
|
|
cabal run
|
||
|
|
cabal run -- deploy api production tags=blue,stable
|
||
|
|
cabal test
|
||
|
|
|
||
|
|
nix build
|
||
|
|
./result/bin/mini-parser deploy api production tags=blue,stable
|
||
|
|
|
||
|
|
nix run . -- deploy api production tags=blue,stable
|
||
|
|
nix flake check
|
||
|
|
```
|