uu-parsinglib-2.9.1.1: Fast, online, error-correcting, monadic, applicative, merging, permuting, interleaving, idiomatic parser combinators.

Safe HaskellNone
LanguageHaskell98

Text.ParserCombinators.UU.Idioms

Synopsis

Documentation

data IF #

Constructors

IF 

Instances

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

Methods

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

data THEN #

Constructors

THEN 

Instances

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

Methods

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

data ELSE #

Constructors

ELSE 

Instances

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

Methods

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

data FI #

Constructors

FI 

Instances

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

Methods

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

data OR #

Constructors

OR 

data String' #

Constructors

String' 

Fields

data Ii #

The Ii is to be pronounced as stop

Constructors

Ii 

Instances

Idiomatic st x (Ii -> P st x) # 

Methods

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

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

The function iI is to be pronounced as start

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

Minimal complete definition

idiomatic

Methods

idiomatic :: P st f -> g #

Instances

Idiomatic st x (Ii -> P st x) # 

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

pNat :: Parser Int #

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']