Giter VIP home page Giter VIP logo

gigaparsec's Introduction

Gigaparsec GitHub Workflow Status Badge-Haddock Hackage Version GitHub license

gigaparsec is a refreshed implementation of a parser combinator library in the parsec style. It has the following aims:

  1. Be approachable for beginners -- both those new to parser combinators and new to Haskell itself. Good documentation and resources are a key priority.
  2. Be complete, with a well-rounded API including support for highly-configurable lexing combinators, and generic expression parsing functionality.
  3. 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.
  4. Be efficient -- while it may not be quite as fast as 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.
  • The common 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.
  • Creating new primitive combinators is not endorsed by the libary: 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 Semantic Versioning: pvp

gigaparsec adheres strictly to Haskell PVP, with the following early-semveresque caveat:

  • Versions 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.
  • Additionally, anything within Text.Gigaparsec.Internal and its submodules is excempt 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.

Development

gigaparsec is built with cabal. Use cabal build to build, and cabal test for testing.

gigaparsec's People

Contributors

j-mie6 avatar nathanielb123 avatar david-davies avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.