@hackage / input-parsers

Extension of the parsers library with more capability and efficiency

Latest0.3.0.2

About

Metadata

  • Last updated , by MarioBlazevic
  • License BSD-3-Clause
  • Categories Parsers
  • Maintained by: blamario@protonmail.com

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.0.1
  2. 8.10.4
  3. 8.8.4
  4. 8.6.5
  5. 8.4.4
  6. 8.2.2
  7. 8.0.2

Package Flags

Use the -f option with cabal commands to enable flags

    binary (on by default)

    You can disable the use of the binary package using `-f-binary`.

    parsec (on by default)

    You can disable the use of the parsec package using `-f-parsec`.

    attoparsec (on by default)

    You can disable the use of the attoparsec package using `-f-attoparsec`.

Readme

input-parsers

An extension of the parsers library

The parsers library provides a number of subclasses of the Alternative type class, as well as lots of combinators useful for writing actual parsers.

What those classes like Parsing and CharParsing lack is the ability to express certain efficient parser primitives like Attoparsec's takeWhile. To rectify for this failing and enable more efficient parsers to be expressed, the present package input-parsers adds type classes InputParsing and InputCharParsing. The common characteristic of almost all their methods is that their parse result has the same type as the parser input, and is a prefix of the input.

The present package also exports the class DeterministicParsing, which provides a number of parser methods that are guaranteed to succeed with a single (typically longest possible) result. This is most useful for writing the lexical layer of a parser, but it can help avoid ambiguities and inefficiencies in general.

Finally, the package provides the class Position to abstract over the position the parser reached in the input stream.