In an attempt to figure out how it tryworks in parsec, I put this in ghci:
λ> parse (try $ string "a") "" "b"
Left (line 1, column 1):
unexpected "b"
expecting "a"
I am not quite sure what I expected, but this is not what I expected, since I thought that the whole goal tryis not to cause an error when the expected thing does not exist.
source
share