tasty-1.1.0.2: Modern and extensible testing framework

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Patterns.Parser

Description

Synopsis

Documentation

data Parser a Source #

A separate Parser data type ensures that we don't forget to skip spaces.

Instances

Monad Parser Source # 

Methods

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

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

return :: a -> Parser a #

fail :: String -> Parser a #

Functor Parser Source # 

Methods

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

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

Applicative Parser Source # 

Methods

pure :: a -> Parser a #

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

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

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

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

Alternative Parser Source # 

Methods

empty :: Parser a #

(<|>) :: Parser a -> Parser a -> Parser a #

some :: Parser a -> Parser [a] #

many :: Parser a -> Parser [a] #

MonadPlus Parser Source # 

Methods

mzero :: Parser a #

mplus :: Parser a -> Parser a -> Parser a #

runParser Source #

Arguments

:: Parser a 
-> String

text to parse

-> ParseResult a 

Run a parser

data ParseResult a Source #

Constructors

Success a 
Invalid 
Ambiguous [a] 

Instances

expr :: Parser Expr Source #

The awk-like expression parser

parseAwkExpr :: String -> Maybe Expr Source #

Parse an awk expression