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

Text.ParserCombinators.UU.Idioms

Synopsis

Documentation

data Ii Source

The Ii is to be pronounced as stop

Constructors

Ii 

Instances

Idiomatic (Str Char state loc) x (Ii -> P (Str Char state loc) x) 

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

test :: 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 "+"  pNatural ')' Ii) "(2+3"
  Result: 5
   Correcting steps: 
     Inserted  ')' at position LineColPos 0 4 4 expecting one of [')', Whitespace, '0'..'9']