tasty-1.4.3: Modern and extensible testing framework
Safe HaskellSafe-Inferred
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

Instances details
Alternative Parser Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

Methods

empty :: Parser a #

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

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

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

Applicative Parser Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

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 #

Functor Parser Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

Methods

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

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

Monad Parser Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

Methods

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

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

return :: a -> Parser a #

MonadPlus Parser Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

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

Instances details
Show a => Show (ParseResult a) Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

Eq a => Eq (ParseResult a) Source # 
Instance details

Defined in Test.Tasty.Patterns.Parser

expr :: Parser Expr Source #

The awk-like expression parser

parseAwkExpr :: String -> Maybe Expr Source #

Parse an awk expression