fastparser: A fast, but bare bones, bytestring parser combinators library.

[ bsd3, deprecated, library, parsing ] [ Propose Tags ]
Deprecated

This package is deprecated as new, fast, parser combinators libraries that are well maintained exist :)


[Skip to Readme]

Modules

[Last Documentation]

  • ByteString
    • Parser
      • ByteString.Parser.Fast

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.3.0, 0.3.0.1, 0.3.1, 0.3.1.1, 0.3.1.2, 0.3.2, 0.4.0, 0.5.0, 0.6.0
Change log CHANGELOG.md
Dependencies base (>=4.13 && <5), bytestring, bytestring-lexing (>=0.5 && <0.6), containers (>=0.5 && <0.7), kan-extensions (>=5 && <6), microlens (>=0.4 && <0.5), semigroups (>=0.18 && <0.19), thyme (>=0.3 && <0.4), transformers (>=0.4), vector-space (>=0.10 && <1) [details]
License BSD-3-Clause
Copyright Simon Marechal
Author Simon Marechal
Maintainer bartavelle@gmail.com
Revised Revision 1 made by SimonMarechal at 2022-09-13T09:06:47Z
Category Parsing
Home page https://github.com/bartavelle/fastparser#readme
Source repo head: git clone https://github.com/bartavelle/fastparser
Uploaded by SimonMarechal at 2020-08-21T08:17:53Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 4279 total (29 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2020-08-21 [all 3 reports]

Readme for fastparser-0.5.0

[back to package description]

Build Status

A very simple, backtracking, fast parser combinator library.

It is measurably faster than attoparsec (36% in this use case), but only works on strict ByteString, lacks many helper functions, and is not resumable. It also should consume a tiny bit less memory for equivalent operations.

When NOT to use fastparser

  • When performance is not the most pressing concern.
  • When you need to parse anything else but strict ByteString.
  • When you need to use a battle-tested library. While very simple, and in constant use by me, this package is still quite experimental.
  • When you need to parse large inputs that are not easily cut into many smaller pieces that can be parsed independently.

How to use fastparser

fastparser works well with small pieces, such as individual log file lines. It is recommended to use it with a coroutine library (such as conduit or pipe), so that the input could be incrementaly consumed, cut into individual records, all of which would end up parsed independently.

One such setup, with the conduit ecosystem, would look like:

sourceFile "/tmp/foo" .| Data.Conduit.Binary.lines .| CL.map (parseOnly parser) .| ...

Other than that, fastparser is fairly close to any other parser combinators library.