Toward better syntax errors

Dan Aloni dan at
Tue Apr 7 20:33:42 UTC 2015


Forwarded here is a link to a blog post I authored about improving
GHC's syntax errors:

In fact, this came about after I started using Happy more extensively,
and at one point thought that GHC could benefit too

The gist of it, is that it was relatively easy to reach an improvement
such as follows (notice 'possible tokens' below):

test i = case i of 2
main = return ()

example1.hs:2:1: parse error (possibly incorrect indentation or mismatched brackets), possible tokens: '|' '->'

It spawned a more extensive discussion regarding type errors here:

Following to that, it was suggested that a further discussion in the GHC
dev mailing list can continue about this direction (syntax errors,
type errors and whatnot).

Dan Aloni

More information about the ghc-devs mailing list