This is a library of parser combinators, originally written by Koen Claessen.
It parses all alternatives in parallel, so it never keeps hold of
the beginning of the input string, a common source of space leaks with
other parsers. The '(+++)' choice combinator is genuinely commutative;
it makes no difference which branch is "shorter".

Transforms a parser into one that does the same, but
in addition returns the exact characters read.
IMPORTANT NOTE: gather gives a runtime error if its first argument
is built using any occurrences of readS_to_P.

chainr p op x parses zero or more occurrences of p, separated by op.
Returns a value produced by a right associative application of all
functions returned by op. If there are no occurrences of p, x is
returned.

chainl p op x parses zero or more occurrences of p, separated by op.
Returns a value produced by a left associative application of all
functions returned by op. If there are no occurrences of p, x is
returned.