
I think this is very similar to what Idris supports for reflecting on errors: http://www.itu.dk/people/drc/drafts/error-reflection-submission.pdf
Aha! Yes, thank you for jogging my memory. I had a good conversation with David Christiansen about this at ICFP, about this very topic, and whether we could steal Idris’s clever ideas and put them in GHC.
· He subsequently wrote a blog posthttp://www.davidchristiansen.dk/2014/09/06/pretty-printing-idris/
· Incidentally, in case it’s not clear this thread on Haskell Caféhttps://www.haskell.org/pipermail/haskell-cafe/2014-November/117054.html goes back to Nov 14. The first message in the series had more useful links
David’s idea is would have much broader scope than just TcErrors. Much of the infrastructure is in place already, since error message are SDocs (an abstract type, private to GHC), not strings.
Design work needed. Start a wiki page. Articulate a vision. Discuss alternatives.
Simon
From: Haskell-Cafe [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of Alejandro Serrano Mena
Sent: 06 February 2015 08:24
To: Adam Gundry
Cc: Haskell Cafe
Subject: Re: [Haskell-cafe] Domain specific error messages
I think this is very similar to what Idris supports for reflecting on errors: http://www.itu.dk/people/drc/drafts/error-reflection-submission.pdf
2015-02-06 8:53 GMT+01:00 Adam Gundry
Hi all, I have been very interested by this discussion when Alberto started it. As there been any progress? The problem is very acute in the Nomyx game I'm developing (www.nomyx.comhttp://www.nomyx.com http://www.nomyx.com). The game is based on a DSL, it's working well, but at the moment only expert Haskell developers can play... I think cryptic error messages is part of the problem. How to improve that? For example, a common error message is the following:
Won't Compile <interactive>:5:28: Couldn't match type ‘'NoEffect’ with ‘'Effect’ Expected type: Exp Effect () Actual type: Exp NoEffect () In the expression: e_1 In the expression: (let e_1 = do { ... } in e_1) :: Exp Effect ()
It's not so helpful and exposing Nomyx internals. A better error message would be to hint that the player forgot a "liftEffect" instruction.
The only quick-and-dirty solution I see is to pattern-match for it and display an additional hint line...
-- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.orgmailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe