uu-parsinglib-2.9.2: Fast, online, error-correcting, monadic, applicative, merging, permuting, interleaving, idiomatic parser combinators.
Safe HaskellNone
LanguageHaskell2010

Text.ParserCombinators.UU.Idioms

Synopsis

Documentation

data IF Source #

Constructors

IF 

Instances

Instances details
Idiomatic st f g => Idiomatic st (a -> f) (IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g Source #

data THEN Source #

Constructors

THEN 

Instances

Instances details
Idiomatic st f g => Idiomatic st (a -> f) (IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g Source #

data ELSE Source #

Constructors

ELSE 

Instances

Instances details
Idiomatic st f g => Idiomatic st (a -> f) (IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g Source #

data FI Source #

Constructors

FI 

Instances

Instances details
Idiomatic st f g => Idiomatic st (a -> f) (IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g Source #

data OR Source #

Constructors

OR 

data String' Source #

Constructors

String' 

Fields

data Ii Source #

The Ii is to be pronounced as stop

Constructors

Ii 

Instances

Instances details
Idiomatic st x (Ii -> P st x) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st x -> Ii -> P st x Source #

iI :: Idiomatic i (a -> a) g => g Source #

The function iI is to be pronounced as start

class Idiomatic st f g | g -> f st where Source #

Methods

idiomatic :: P st f -> g Source #

Instances

Instances details
Idiomatic st x (Ii -> P st x) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st x -> Ii -> P st x Source #

Idiomatic st f g => Idiomatic st (a -> f) (IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> IF -> Bool -> THEN -> P st a -> ELSE -> P st a -> FI -> g Source #

Idiomatic st f g => Idiomatic st ((a -> b) -> f) ((a -> b) -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st ((a -> b) -> f) -> (a -> b) -> g Source #

Idiomatic st f g => Idiomatic st (a -> f) (P st a -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P st (a -> f) -> P st a -> g Source #

(Idiomatic (Str Char state loc) f g, IsLocationUpdatedBy loc Char, ListLike state Char) => Idiomatic (Str Char state loc) f (Char -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P (Str Char state loc) f -> Char -> g Source #

(Idiomatic (Str Char state loc) f g, IsLocationUpdatedBy loc Char, ListLike state Char) => Idiomatic (Str Char state loc) f (String -> g) Source # 
Instance details

Defined in Text.ParserCombinators.UU.Idioms

Methods

idiomatic :: P (Str Char state loc) f -> String -> g Source #

pNat :: Parser Int Source #

The idea of the Idiom concept is that sequential composition operators can be inferred from the type of the various operands

>>> run (iI (+) '(' pNatural "plus"  pNatural ')' Ii) "(2 plus 3"
  Result: 5
   Correcting steps: 
     Inserted  ')' at position LineColPos 0 4 4 expecting one of [')', Whitespace, '0'..'9']