inchworm-1.0.2.3: Inchworm Lexer Framework

Safe HaskellSafe
LanguageHaskell98

Text.Lexer.Inchworm.Scanner

Synopsis

Documentation

data Scanner m loc input a Source #

Scanner of input tokens that produces a result value of type a when successful.

Constructors

Scanner 

Fields

Instances
Monad m => Monad (Scanner m loc input) Source # 
Instance details

Defined in Text.Lexer.Inchworm.Scanner

Methods

(>>=) :: Scanner m loc input a -> (a -> Scanner m loc input b) -> Scanner m loc input b #

(>>) :: Scanner m loc input a -> Scanner m loc input b -> Scanner m loc input b #

return :: a -> Scanner m loc input a #

fail :: String -> Scanner m loc input a #

Monad m => Functor (Scanner m loc input) Source # 
Instance details

Defined in Text.Lexer.Inchworm.Scanner

Methods

fmap :: (a -> b) -> Scanner m loc input a -> Scanner m loc input b #

(<$) :: a -> Scanner m loc input b -> Scanner m loc input a #

Monad m => Applicative (Scanner m loc input) Source # 
Instance details

Defined in Text.Lexer.Inchworm.Scanner

Methods

pure :: a -> Scanner m loc input a #

(<*>) :: Scanner m loc input (a -> b) -> Scanner m loc input a -> Scanner m loc input b #

liftA2 :: (a -> b -> c) -> Scanner m loc input a -> Scanner m loc input b -> Scanner m loc input c #

(*>) :: Scanner m loc input a -> Scanner m loc input b -> Scanner m loc input b #

(<*) :: Scanner m loc input a -> Scanner m loc input b -> Scanner m loc input a #

scanSourceToList :: Monad m => Source m loc [i] -> Scanner m loc [i] a -> m ([a], loc, [i]) Source #

Apply a scanner to a source of input tokens, where the tokens are represented as a lazy list.

The result values are also produced in a lazy list.