logoalt Hacker News

mrkeen • today at 1:23 PM • 0 replies • view on HN

If you use an Either instead of a List, then you can write an or combinator, which accepts two parsers and tries the second if the first fails. It branches on the Left/Right of the Either.

If it's a List, wouldn't you be forced to write the Cartesian product of two parsers instead?