Poor parse error
Given the fragment:
f x = do case x of Just foo -> do stmt1 stmt2 stmt3 stmt4 stmt5 stmt6 Nothing -> a <- var stmt1 stmt2 stmt3
There is a parse error after the
Nothing, I should have included a
bug.hs:1:9: Parse error in pattern
This error message can be made to be arbitrarily far away from the point at which the error actually occurs.
Haskell-src-exts does far better with:
bug.hs:10:19: Parse error in pattern
<- binding errors against the arrow, rather than the (assumed) start of the pattern seems to be a better choice.