1
1
mirror of https://github.com/Yuras/scanner.git synced 2024-10-27 00:19:00 +03:00
Fast non-backtracking incremental combinator parsing for bytestrings
Go to file
2021-04-03 00:12:25 +03:00
bench Use Cereal.getBytes instead of Cereal.getByteString 2016-09-23 10:17:06 +03:00
compat Enable travis CI 2016-04-02 16:51:01 +03:00
examples/Redis Add Zepto into the benchmark 2016-04-04 09:30:36 +03:00
lib Support GHC 8.8 and base-4.13 2019-09-18 12:08:32 +01:00
spec Add scanWith entry point 2016-04-03 16:44:36 +03:00
.gitignore Non-backtracking parser combinator library 2016-04-02 04:42:47 +03:00
.travis.yml Add ghc 8.10 and 9.0 to CI (#13) 2021-04-03 00:12:25 +03:00
changelog.md Bump version 2019-09-18 17:12:08 +03:00
LICENSE Non-backtracking parser combinator library 2016-04-02 04:42:47 +03:00
README.md Add stackage url to README 2016-04-03 20:56:45 +03:00
scanner.cabal Bump version 2019-09-18 17:12:08 +03:00
Setup.hs Non-backtracking parser combinator library 2016-04-02 04:42:47 +03:00

scanner

Fast non-backtracking incremental combinator parsing for bytestrings

Build Status

On hackage: http://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:

Bechmark results

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