A degenerate example of us using List for error reporting would be the following parser application:
p = string "123"
Parsec.run "-" (p <|> p <|> p) "322"
The reference implementation of megaparsec is using Sets for error reporting, thus will report "Failed to parse line 1 symbol 1: found '3, expected '1". Our parser will report: "Failed to parse line 1 symbol 1: found '3, expected '1. Failed to parse line 1 symbol 1: found '3, expected '1. Failed to parse line 1 symbol 1: found '3, expected '1.".
How?
[ ] Figure out how to append to HashSets.
[ ] Validate that all the types can append to HashSets.
[ ] Switch Lists to HashSets and append in errors.
Why?
A degenerate example of us using List for error reporting would be the following parser application:
The reference implementation of megaparsec is using
Set
s for error reporting, thus will report "Failed to parse line 1 symbol 1: found '3, expected '1". Our parser will report: "Failed to parse line 1 symbol 1: found '3, expected '1. Failed to parse line 1 symbol 1: found '3, expected '1. Failed to parse line 1 symbol 1: found '3, expected '1.".How?