Gigaparsec
Refreshed parsec-style library for compatibility with Scala parsley
Install / Use
/learn @j-mie6/GigaparsecREADME
Gigaparsec

gigaparsec is a refreshed implementation of a parser combinator library in the parsec style.
It has the following aims:
- Be approachable for beginners -- both those new to parser combinators and new to Haskell itself. Good documentation and resources are a key priority.
- Be complete, with a well-rounded API including support for highly-configurable lexing combinators, and generic expression parsing functionality.
- Be modern, with first-class support for the patterns outlined in Design Patterns for Parser Combinators (Functional Pearl). It also strives for API compatibility with Scala
parsley, to allow for easy porting of both parsers, knowledge, and learning materials. - Be efficient -- while it may not be quite as fast as
megaparsec, we hope that it will still remain reasonably efficient, as least more thanparsec, whilst still providing additional benefits.
To achieve these aims, some departures have been made
from many of the classic parsec-style implementations:
gigaparsec'sParsectype is simple: only one type-parameter. There are a few consequences of this:Parsecdoes not have aParsecTvariant: occasionally, people may wish to thread other monads through a parser, however, most of the practical use-cases of this can be captured usinggigaparsec's state and references, implemented withreference-threads. The exception here isIOoperations.Parseccannot generate the type of the input stream: currently, the input is assumed to beString. In future, however, it may be possible to specify an implementation for the input without resorting to noise in the type-signatures.Parseccannot specify a custom error type to be carried through parsing. In practice, a rich typeclass-driven API can be used to format error messages in the desired way, as well as change their types at the point of callingparse.
- The common
trycombinator has been more appropriately named as theatomiccombinator: this is consistent with theparsleynaming, and we believe that this name better embodies the combinator's purpose. - Creating new primitive combinators is not endorsed by the library: while the capacities to make them have been exposed, they are not made part of the public API to allow freedom for the maintainers to continue to innovate and improve the internals -- this includes continued optimisation.
Current HEAD documentation can be found here: for
stable documentation please consult Hackage directly.
Library Evolution 
gigaparsec adheres strictly to Haskell PVP, with the following early-semver-esque caveat:
- Versions
0.M.m.pare to be treated as pre-release, with high-volatility. While the major componentMwill still be bumped for every major change, it is likely that there will be high turnover for these major bumps until the library hits1.0.0.0, which will be considered more stable. Changes in these bumps are likely to be more disruptive than usual. - Additionally, anything within
Text.Gigaparsec.Internaland its submodules is exempt from the PVP policy, and may change at any time. While you are free to rely on these internals if you need to, this is strongly discouraged, and we will make no attempt to keep them internally consistent, especially within the0.M.n.pseries.
Development
gigaparsec is built with cabal.
Use cabal build to build, and cabal test for testing.
Related Skills
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
