Simple lexer based on applicative regular expressions https://github.com/feuerbach/lexer-applicative

Version on this page:
LTS Haskell 11.22:
Stackage Nightly 2018-03-12:
Latest on Hackage:

See all snapshots lexer-applicative appears in

MIT licensed and maintained by Roman Cheplyaka

Module documentation for

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



Fix compatibility with GHC 8.4 and drop support for GHC 7.x

Fix a link in the README


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


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.


Add tokensEither


Upgrade to srcloc 0.5

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

Depends on 3 packages:
Used by 1 package:
comments powered byDisqus