streamly
streamly copied to clipboard
Parallel alternative parsers
In an alternative combinator we can feed the input in parallel to both the parsers until one of the parsers yields a result. We could use different strategies for using the result e.g. (1) compute in parallel but use the second parser only if the first parser fails, (2) use whichever parser yields the result first and discard the other.
The parallel parsing could be done sequentially or concurrently.