A base parser.
A type-guard predicate applied to the matched value to decide whether to keep it.
Make a new parser that keeps a match from a given parser only if a predicate passes; otherwise discards it (returns a NonMatch).
Use satisfy to test a token at the current position instead of a value matched by another parser.
Use takeWhile to accumulate 0 or more matches while predicate holds.
mapR can be used if you need to filter and transform matches at the same time.
But it is better to use filter
and map instead in most cases.
A base parser.
A predicate applied to the matched value to decide whether to keep it.
Make a new parser that keeps a match from a given parser only if a predicate passes; otherwise discards it (returns a NonMatch).
This overload uses a type guard predicate to narrow the value type on success.
Use satisfy to test a token at the current position instead of a value matched by another parser.
Use takeWhile to accumulate 0 or more matches while predicate holds.
mapR can be used if you need to filter and transform matches at the same time. But it is better to use
filter
and map instead in most cases.