Bind<T, U>(Parser<T>, T ➜ Parser<U>) ➜ Parser<U>
Transforms a successful parse result into a new parser. Also implemented as
SelectMany<T, U>
.
Map<T, U>(Parser<T>, T ➜ U) ➜ Parser<U>
Transforms a successful parse result. Also implemented as
Select<T, U>
.
SelectMany<T, U, V>(Parser<T>, T ➜ Parser<U>, (T, U) ➜ V ) ➜ Parser<V>
Transforms a successful parse result into a new parser, combining the results of both parsers.
Partial<T, U>(Parser<T>, T ➜ Parser<U>) ➜ Parser<(T, IParseResult<U>)>
Attempts to transform a successful parse result into a new parser. On success, the resulting pair has a first element that is the value of the
Parser<T>
if it succeeded, and a second element that is the result of theParser<U>
returned from the binding function.
Or<T, U>(Parser<T>, Parser<U>) ➜ Parser<(IParseResult<T>, IParseResult<U>)>
Attempts to match two parsers in sequence, if that fails, attempts to match one or the other. On success, the resulting pair will have a first element that is the result of the
Parser<T>
, and a second element that is the result of theParser<U>
, where at least one has succeeded.
Join<T, S>(Parser<S>, params Parser<T>) ➜ Parser<<T>>
Alternates applying a parser from a sequence with a separator parser, ignoring the results of the separator.
SeparatedBy<T, S>(Parser<T>, Parser<S>) ➜ Parser<IList<T>>
Alternates applying two parsers, returning only the results of the first parser.