gigaparsec
is a refreshed implementation of a parser combinator library in the parsec
style.
It has the following aims:
parsley
, to allow for easy porting of both
parsers, knowledge, and learning materials.megaparsec
, we hope that it will still remain reasonably efficient, as least more than parsec
, whilst still providing additional benefits.To achieve these aims, some departures have been made
from many of the classic parsec
-style implementations:
gigaparsec
's Parsec
type is simple: only one type-parameter. There are a few consequences of this:
Parsec
does not have a ParsecT
variant: occasionally, people may wish to thread other monads through a parser, however, most of the practical use-cases of this can be captured using gigaparsec
's registers. The exception here is IO
operations.Parsec
cannot generate the type of the input stream: currently, the input is assumed to be String
. In future, however, it may be possible to specify an implementation for the input without resorting to noise in the type-signatures.Parsec
cannot 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 calling parse
.try
combinator has been more appropriately
named as the atomic
combinator: this is consistent with the parsley
naming, and we believe that this name is more true to the combinators purpose.Current HEAD
documentation can be found here: for
stable documentation please consult Hackage directly.
gigaparsec
adheres strictly to Haskell PVP, with the following early-semver
esque caveat:
0.M.m.p
are to be treated as pre-release, with high-volatility. While the major
component M
will still be bumped for every major change, it is likely that there will be high
turnover for these major bumps until the library hits 1.0.0.0
, which will be considered more
stable. Changes in these bumps are likely to be more disruptive than usual.Text.Gigaparsec.Internal
and 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 the 0.M.n.p
series.gigaparsec
is built with cabal.
Use cabal build
to build, and cabal test
for testing.