parsnip: A fast, minimal parser

[ graphics, library ] [ Propose Tags ]

A fast, minimal parser.

parsnip parses null-terminated input strings with an absolute minimum of internal state. It copies the input to a c string and works its way through hand-over-hand with just an Addr# as the internal state.

It uses reflection-like tricks to lift the input ByteString into a constraint that is then passed to just the combinators that need access to it to compute position, snip out slices of the original, or ask the number of bytes remaining, but none of the monadic combinators nor simple satisfy or eof predicates need access to this information.

Because of the null-termination, we can't assume that we can handle binary inputs, but this works well for text-based source languages.

[Skip to Readme]
Versions [faq] 0
Change log
Dependencies attoparsec, base (>=4.15 && <5), bytestring, containers, data-default, ghc-prim, primitive [details]
License (BSD-2-Clause OR Apache-2.0)
Copyright Copyright (c) 2019-2021 Edward Kmett
Author Edward Kmett
Maintainer Edward Kmett <>
Category Graphics
Home page
Source repo head: git clone
Uploaded by EdwardKmett at 2021-03-24T01:32:48Z
Distributions NixOS:0
Downloads 31 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]


[Index] [Quick Jump]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for parsnip-0

[back to package description]



This is a rather minimal parsing library for applications that do not need nice error messages.

Use with a library like parsers or parser-combinators to fill in the missing functionality.

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on

-Edward Kmett