| CARVIEW |
scanner: Fast non-backtracking incremental combinator parsing for bytestrings
Downloads
- scanner-0.3.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1, 0.2, 0.3, 0.3.1 |
|---|---|
| Change log | changelog.md |
| Dependencies | base (<5), bytestring, fail [details] |
| License | BSD-3-Clause |
| Copyright | (c) Yuras Shumovich 2016 |
| Author | Yuras Shumovich |
| Maintainer | shumovichy@gmail.com |
| Uploaded | by YurasShumovich at 2019-09-18T13:58:34Z |
| Category | Parsing |
| Home page | https://github.com/Yuras/scanner |
| Source repo | head: git clone git@github.com:Yuras/scanner.git |
| Distributions | Debian:0.3.1, LTSHaskell:0.3.1, NixOS:0.3.1, Stackage:0.3.1 |
| Reverse Dependencies | 6 direct, 153 indirect [details] |
| Downloads | 10419 total (20 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2019-09-18 [all 1 reports] |
Readme for scanner-0.3.1
[back to package description]scanner
Fast non-backtracking incremental combinator parsing for bytestrings
On hackage: https://hackage.haskell.org/package/scanner
On stackage: https://www.stackage.org/package/scanner
It is often convinient to use backtracking to parse some sophisticated input. Unfortunately it kills performance, so usually you should avoid backtracking.
Often (actually always, but it could be too hard sometimes) you can implement your parser without any backtracking. It that case all the bookkeeping usuall parser combinators do becomes unnecessary. The scanner library is designed for such cases. It is often 2 times faster then attoparsec.
As an example, please checkout redis protocol parser included into the repo, both using attoparsec and scanner libraries: https://github.com/Yuras/scanner/tree/master/examples/Redis
Benchmark results:

But if you really really really need backtracking, then you can just inject attoparsec parser into a scanner: https://hackage.haskell.org/package/scanner-attoparsec