Skip to content

Commit 4e3bde2

Browse files
committed
Focus more on GHC/HLS integration.
1 parent 7ebe7d3 commit 4e3bde2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

proposals/000-error-messages.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Introduction
22

33
This proposal seeks technical coordination from the Haskell Foundation
4-
for improving the interop story around Haskell tooling error messages.
4+
for improving the interop story between GHC and HLS. Once that is
5+
done well, we might imagine taking our gained knowledge to improve
6+
other interop around error messages.
57
While much of the work may be doable by volunteers, the HF would play
68
a role in harnessing and corralling the volunteers, as well as coordinating
79
common APIs between tools that are both easy to implement and easy to use.
@@ -13,8 +15,8 @@ among all tooling central to Haskell.
1315
Currently, there is no discipline around error messages. This lack of
1416
structure manifests itself in a number of ways:
1517

16-
- Some tools parse the error messages that other tools
17-
produce. This is fragile, wasteful, and hard to keep up-to-date. For
18+
- HLS must parse the error messages that GHC
19+
produces. This is fragile, wasteful, and hard to keep up-to-date. For
1820
example, the HLS looks to see if a GHC extension name appears in an error
1921
message, in order to allow the user to automatically enable it via a pragma.
2022
But since `KindSignatures` is a substring of `StandaloneKindSignatures`, any
@@ -23,7 +25,7 @@ structure manifests itself in a number of ways:
2325
would actually work. While there is a workaround here, we can see that
2426
better communication between GHC and HLS would avoid this class of problem.
2527

26-
- Many Haskell error messages refer to advanced concepts. This is unavoidable,
28+
- Many GHC error messages refer to advanced concepts. This is unavoidable,
2729
as Haskell has advanced features. However, telling a user that their rigid
2830
type variable does not unify with a type because there is a kind mismatch
2931
is utterly bewildering to Haskell learners. Applying structure to error messages
@@ -43,16 +45,13 @@ not just as (fancy) strings. [This wiki page](https://gitlab.haskell.org/ghc/ghc
4345
and [this blog post](https://well-typed.com/blog/2021/08/the-new-ghc-diagnostic-infrastructure/) describe
4446
roughly the state of play. However, this work currently lacks a very important
4547
ingredient: clients. That is, if GHC is exporting new, fancy datatypes encoding
46-
its error messages, are these datatypes of use to, say, HLS? We've reached out
48+
its error messages, are these datatypes of use to HLS? We've reached out
4749
to potential clients for feedback, but the best response we've gotten is something
48-
along the lines of "sure, looks good". That's encouraging, but I would want to
50+
along the lines of "sure, looks good". That's encouraging, but I would want to have
4951
a little more coordination to make sure that the interface GHC is building is one
5052
that can be easily consumed. The HF could help here by coordinating this
5153
communication between projects.
5254

53-
Furthermore, if this is successful in increasing interop between (say) GHC
54-
and HLS, then we can expand the idea to other tooling, as well.
55-
5655
The website describing error messages and error-generator identification
5756
are both fresh in this proposal.
5857

@@ -131,7 +130,8 @@ structured format.
131130

132131
1. As capacity is available, the Coordinator would also organize (or encourage a volunteer
133132
to organize) a website where error messages could be explained. This might be a wiki,
134-
or a git repository, or something exportable to e.g. readthedocs.io. Figuring out a good
133+
or a git repository, or something exportable to e.g. readthedocs.io. This might even be
134+
incorporated into the user manual. Figuring out a good
135135
format would be the responsibility of the Coordinator, possibly by contacting stakeholders
136136
with a survey or looking at other language communities.
137137

0 commit comments

Comments
 (0)