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

Safe HaskellNone

Text.ParserCombinators.UU.Idioms

Synopsis

Documentation

data IF Source

Constructors

IF 

Instances

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

data THEN Source

Constructors

THEN 

Instances

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

data ELSE Source

Constructors

ELSE 

Instances

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

data FI Source

Constructors

FI 

Instances

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

data OR Source

Constructors

OR 

data String' Source

Constructors

String' 

Fields

fromStr :: String
 

data Ii Source

The Ii is to be pronounced as stop

Constructors

Ii 

Instances

Idiomatic st x (Ii -> P st x) 

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

The function iI is to be pronounced as start

class Idiomatic st f g | g -> f st whereSource

Methods

idiomatic :: P st f -> gSource

Instances

Idiomatic 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) 
Idiomatic st f g => Idiomatic st ((a -> b) -> f) ((a -> b) -> g) 
Idiomatic st f g => Idiomatic 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) 
(Idiomatic (Str Char state loc) f g, IsLocationUpdatedBy loc Char, ListLike state Char) => Idiomatic (Str Char state loc) f (String -> g) 

pNat :: Parser IntSource

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