Inside 245-5D

Existential Pontification and Generalized Abstract Digressions

Parsec: “try a <|> b” considered harmful

tl;dr The scope of backtracking try should be minimized, usually by placing it inside the definition of a parser. Have you ever written a Parsec parser and gotten a really uninformative error message? "test.txt" (line 15, column 7): unexpected 'A' expecting end of input The line and the column are randomly somewhere in your document, […]

  • May 17, 2014