package containers

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module CCParse.InfixSource

Sourceval (>|=) : 'a t -> ('a -> 'b) -> 'b t

Map.

Sourceval (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Monadic bind. p >>= f results in a new parser which behaves as p then, in case of success, applies f to the result.

Sourceval (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Applicative.

Sourceval (<*) : 'a t -> _ t -> 'a t

a <* b parses a into x, parses b and ignores its result, and returns x.

Sourceval (*>) : _ t -> 'a t -> 'a t

a *> b parses a, then parses b into x, and returns x. The results of a is ignored.

Sourceval (<|>) : 'a t -> 'a t -> 'a t

a <|> b tries to parse a, and if a fails without consuming any input, backtracks and tries to parse b, otherwise it fails as a. See try_ to ensure a does not consume anything (but it is best to avoid wrapping large parsers with try_).

Sourceval (<?>) : 'a t -> string -> 'a t

a <?> msg behaves like a, but if a fails without consuming any input, it fails with msg instead. Useful as the last choice in a series of <|>: a <|> b <|> c <?> "expected a|b|c".

OCaml

Innovation. Community. Security.