HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleAgda-2.7.0.1Haskell2010

Agda.Syntax.Parser.Alex

This module defines the things required by Alex and some other Alex related things.

  • 6 types
  • 9 values
  • PackageAgda-2.7.0.1
  • Exports15
  • LanguageHaskell2010
  • LicenceMIT
  • SourceAlex.hs

Alex requirements

5 declarations

Returns the next byte, and updates the AlexInput value.

A trick is used to handle the fact that there are more than 256 Unicode code points. The function translates characters to bytes in the following way:

  • Whitespace characters other than '\t' and '\n' are translated to ' '.

  • Non-ASCII alphabetical characters are translated to 'z'.

  • Other non-ASCII printable characters are translated to '+'.

  • Everything else is translated to '\1'.

Note that it is important that there are no keywords containing 'z', '+', ' ' or '\1'.

This function is used by Alex (version 3).

Lex actions

8 declarations
newtypenewtype LexAction r
#

In the lexer, regular expressions are associated with lex actions who's task it is to construct the tokens.

Instances4Monad, Functor, Applicative, MonadState

Monad operations

2 declarations