futhark-0.23.1: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Futhark.Parser.Lexer.Wrapper

Description

Utility definitions used by the lexer. None of the default Alex "wrappers" are precisely what we need. The code here is based on the "monad-bytestring" wrapper. The code here is completely Futhark-agnostic, and perhaps it can even serve as inspiration for other Alex lexer wrappers.

Synopsis

Documentation

data Alex a Source #

Instances

Instances details
Applicative Alex Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Wrapper

Methods

pure :: a -> Alex a #

(<*>) :: Alex (a -> b) -> Alex a -> Alex b #

liftA2 :: (a -> b -> c) -> Alex a -> Alex b -> Alex c #

(*>) :: Alex a -> Alex b -> Alex b #

(<*) :: Alex a -> Alex b -> Alex a #

Functor Alex Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Wrapper

Methods

fmap :: (a -> b) -> Alex a -> Alex b #

(<$) :: a -> Alex b -> Alex a #

Monad Alex Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Wrapper

Methods

(>>=) :: Alex a -> (a -> Alex b) -> Alex b #

(>>) :: Alex a -> Alex b -> Alex b #

return :: a -> Alex a #

type AlexInput = (Pos, Char, ByteString, Int64) Source #

The input type. Contains:

  1. current position
  2. previous char
  3. current input string
  4. bytes consumed so far

data LexerError Source #

Constructors

LexerError Loc Text 

Instances

Instances details
Show LexerError Source # 
Instance details

Defined in Language.Futhark.Parser.Lexer.Wrapper