Fast non-backtracking incremental combinator parsing for bytestrings

LTS Haskell 13.26:0.3
Stackage Nightly 2019-06-21:0.3
Latest on Hackage:0.3

See all snapshots scanner appears in

BSD-3-Clause licensed by Yuras Shumovich
Maintained by

Module documentation for 0.3

This version can be pinned in stack with:scanner-0.3@sha256:6aaf7e9a247ba1e7dad0a191ae82cfbdc61e6be727419aeb765f08196c3cc32f,1988


Fast non-backtracking incremental combinator parsing for bytestrings

Build Status

On hackage:

On stackage:

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:

Benchmark results:

Bechmark results

But if you really really really need backtracking, then you can just inject attoparsec parser into a scanner:



  • add foldWhile, foldWhile1, satisfy, satisfyMaybe



  • initial release
Depends on 2 packages(full list with versions):
Used by 1 package in nightly-2019-06-11(full list with versions):
comments powered byDisqus