Toward better syntax errors

Hello, Forwarded here is a link to a blog post I authored about improving GHC's syntax errors: http://blog.aloni.org/posts/toward-better-ghc-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): input: -- test i = case i of 2 main = return () output: -- example1.hs:2:1: parse error (possibly incorrect indentation or mismatched brackets), possible tokens: '|' '->' It spawned a more extensive discussion regarding type errors here: https://www.reddit.com/r/haskell/comments/31m7pc/toward_better_ghc_syntax_er... 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

Thank Dan. I'm keen on better error messages. If you want to change Happy, though, you need talk to Simon Marlow. Simon | -----Original Message----- | From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of Dan | Aloni | Sent: 07 April 2015 21:34 | To: ghc-devs@haskell.org | Subject: Toward better syntax errors | | Hello, | | Forwarded here is a link to a blog post I authored about improving | GHC's syntax errors: | | http://blog.aloni.org/posts/toward-better-ghc-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): | | | input: | -- | test i = case i of 2 | main = return () | | | output: | -- | example1.hs:2:1: parse error (possibly incorrect indentation or | mismatched brackets), possible tokens: '|' '->' | | | It spawned a more extensive discussion regarding type errors here: | | https://www.reddit.com/r/haskell/comments/31m7pc/toward_better_ghc_syntax | _errors/ | | 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 | _______________________________________________ | ghc-devs mailing list | ghc-devs@haskell.org | http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

On Tue, Apr 07, 2015 at 10:11:07PM +0000, Simon Peyton Jones wrote:
Thank Dan. I'm keen on better error messages.
If you want to change Happy, though, you need talk to Simon Marlow.
Definitely, and there has been already a pull request recently open inthe Happy github repo. The mailing list is a better platform for discussions though :) -- Dan Aloni
participants (2)
-
Dan Aloni
-
Simon Peyton Jones