Buf_read.Syntax
Convenient syntax for some of the combinators.
val let+ : 'a parser -> ('a -> 'b) -> 'b parser
Syntax for map.
map
val let* : 'a parser -> ('a -> 'b parser) -> 'b parser
Syntax for bind
bind
val and+ : 'a parser -> 'b parser -> ('a * 'b) parser
Syntax for pair
pair
val and* : 'a parser -> 'b parser -> ('a * 'b) parser
Syntax for pair (same as and+).
and+
val (<*>) : 'a parser -> 'b parser -> ('a * 'b) parser
a <*> b is pair a b.
a <*> b
pair a b
val (<*) : 'a parser -> 'b parser -> 'a parser
a <* b is map fst (pair a b). It parses two things and keeps only the first.
a <* b
map fst (pair a b)
val (*>) : 'a parser -> 'b parser -> 'b parser
a *> b is map snd (pair a b). It parses two things and keeps only the second.
a *> b
map snd (pair a b)