| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Text.ParserCombinators.UU.Idioms
Documentation
Constructors
| IF |
Constructors
| THEN |
Constructors
| ELSE |
Constructors
| FI |
class Idiomatic st f g | g -> f st where Source
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) |
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']
show_demos :: IO () Source