input-parsers

Extension of the parsers library with more capability and efficiency

LTS Haskell 23.0:0.3.0.2
Stackage Nightly 2024-12-18:0.3.0.2
Latest on Hackage:0.3.0.2

See all snapshots input-parsers appears in

BSD-3-Clause licensed by Mario Blažević
Maintained by [email protected]
This version can be pinned in stack with:input-parsers-0.3.0.2@sha256:41a73ffbba914aea221bc7fe3a5ec0e84f1f54c42426ed9d3c3f1a57f19c25b6,1986

Module documentation for 0.3.0.2

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.

Changes

Revision history for input-parsers

0.3.0.2 – 2023-11-25

  • Incremented the upper bound of the bytestring and text dependencies.

0.3.0.1 – 2023-06-17

  • Incremented the upper bound of the transformers dependency.

0.3 – 2022-10-02

  • Dropped support for GHC < 8.4
  • Incremented the upper bound of the monoid-subclasses dependency.
  • Added -Wall and fixed all warnings.

0.2.3.2 – 2022-03-25

  • Incremented the upper bound of the text dependency.

0.2.3.1 – 2021-11-25

  • Incremented the upper bound of the optional attoparsec dependency.

0.2.3 – 2021-03-26

  • Improved documentation
  • Fixed compilation with GHC 8.2.2

0.2.2 – 2021-03-26

  • Move Data.ByteString and Data.ByteString.Lazy imports outside ifdef (by Gary Coady)
  • Exported all Position methods

0.2.1 – 2021-03-09

  • Changed the default instance of ParserPosition, made Position a subclass of Ord.

0.2 – 2021-03-07

  • Added ParserPosition and made Position a class. Deprecated.

0.1.0.1 – 2020-07-19

  • Incremented the upper bound of base dependency.

0.1.0.0 – 2020-07-18

  • First version. Released on an unsuspecting world.