lexer-applicative

Simple lexer based on applicative regular expressions

https://github.com/feuerbach/lexer-applicative

Version on this page:2.1.0.1
LTS Haskell 23.1:2.1.0.2
Stackage Nightly 2024-12-09:2.1.0.2
Latest on Hackage:2.1.0.2

See all snapshots lexer-applicative appears in

MIT licensed and maintained by Roman Cheplyaka
This version can be pinned in stack with:lexer-applicative-2.1.0.1@sha256:39dd57f4fa2415a7482e96423d8e1345edae0a1ba4fef1cc16119fe9ffd710fd,1427

Module documentation for 2.1.0.1

  • Language
    • Language.Lexer
      • Language.Lexer.Applicative

Simple applicative lexer based on the article Lexical analysis with parser combinators and the regex-applicative library.

Changes

Changelog

2.1

  • Restore compatibility with older GHCs
  • Change the type of longestShortest

2.0

This is a major redesign of the API. Notable changes:

  • The lexer now supports parsing the longest prefix/shortest suffix (see longestShortest)
  • Instead of throwing an exception, we return a stream. The stream can be consumed directly, converted to a list or either-error-list of tokens.

1.1.1

Add tokensEither

1.1

Upgrade to srcloc 0.5

1.0.0.1

Signal a lexical error (instead of looping) when a regex does not consume any characters