[Haskell-cafe] shorter error messages

Tom Smeding x at tomsmeding.com
Tue Mar 16 16:40:41 UTC 2021


In any case, the haskell language server just uses GHC internally, so it just shortens the GHC message. But then I believe the same result could be accomplished by some simple text manipulation on GHC's normal output.

- Tom



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, March 16, 2021 4:58 PM, stuebinm via Haskell-Cafe <haskell-cafe at haskell.org> wrote:

> I've found this problem to be largely solved when using the haskell
> language server with the emacs lsp mode — it just marks whatever call
> would throw a type error and gives you a (usually) reasonably short hint
> of what went wrong. So far I've also not seen any false alerts — but
> then I've only been using it for a week or so, so maybe I just haven't
> run into them yet.
>
> Of course, this doesn't really help if you really want to just use ghc
> by itself, but perhaps it would be possible to write some minimal client
> for the language server which just shows you the errors?
>
> Barring that, I guess you /could/ do something like
> $ ghc 2>&1 | grep "Couldn't match" -A 4
> to get a list of type errors, but that's rarely actually useful ...
>
> stuebinm
>
> On 16.03.21 16:21, Carter Schonwald wrote:
>
> > I don’t think so! But it’s a great idea perhaps!  How do other tools do
> > it? And or is there a bread crumb you could do find next/previous match
> > on the current output for? Or is that missing and the real issue to address?
> > On Tue, Mar 16, 2021 at 9:02 AM Ben Franksen <ben.franksen at online.de
> > mailto:ben.franksen at online.de> wrote:
> >
> >     Is there a way to tell ghc to print errors, especially type errors in a
> >     more concise way? Ideally one or two lines of text? I hate it when I
> >     have to scroll several pages of text just to see the next/previous error
> >     location.
> >
> >     Cheers
> >     Ben
> >     --
> >     Niemand hat das Recht zu gehorchen. -- Hannah Arendt
> >
> >     _______________________________________________
> >     Haskell-Cafe mailing list
> >     To (un)subscribe, modify options or view archives go to:
> >     http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> >     <http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe>
> >     Only members subscribed via the mailman list are allowed to post.
> >
> >
> > Haskell-Cafe mailing list
> > To (un)subscribe, modify options or view archives go to:
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> > Only members subscribed via the mailman list are allowed to post.
>
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.




More information about the Haskell-Cafe mailing list