You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/accepted/051-ghc-base-libraries.rst
+33-24Lines changed: 33 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,8 +46,8 @@ responsibilities (e.g. who curates which package),
46
46
and processes (e.g. who should be consulted and when)
47
47
that support both CLC and the GHC team to follow their respective goals without tripping over each other.
48
48
49
-
> The proposal is based on `HF Proposal 47 <https://github.com/haskellfoundation/tech-proposals/pull/47>`__, but is independent of it.
50
-
> You can find more background in `CLC issue #146 <https://github.com/haskell/core-libraries-committee/issues/146>`__.
49
+
The proposal is based on `HF Proposal 47 <https://github.com/haskellfoundation/tech-proposals/pull/47>`__, but is independent of it.
50
+
You can find more background in `CLC issue #146 <https://github.com/haskell/core-libraries-committee/issues/146>`__.
51
51
52
52
Things we all agree about
53
53
=========================
@@ -103,29 +103,13 @@ All three packages conform rigorously to the PVP.
103
103
104
104
Some observations about this structure:
105
105
106
-
- We should use all possible social and technical means to discourage people from depending directly on ``ghc-internals``, because if such dependencies become frequent and ossified, it will lead to future pain when the API changes.
107
-
Saying "we told you not to rely on it" may be true, but won't lessen that pain.
108
-
What mechanisms could we use?
106
+
- We should develop both social and technical mechanisms to discourage people from depending directly on ``ghc-internals``, because if such dependencies become frequent and ossified, it will lead to future pain when the API changes.
107
+
The very name ``ghc-internals`` should serve as a very strong signal in its own right, but even so, saying "we told you not to rely on it" may be true but won't lessen that pain.
108
+
The specific mechanisms do not form part of this proposal, but some possibilities are discussed in :ref:`discourage-brainstorm`.
109
109
110
-
- The name ``ghc-internals`` is a pretty strong signal all by itself.
111
-
112
-
- Cabal description and README explains how it is intended used (and not used).
113
-
114
-
- Hoogle could (by default anyway) never show stuff from ``ghc-internals``.
115
-
116
-
- Do not upload Haddocks for ``ghc-internals`` to Hackage.
117
-
(Ditto ``ghc-prim``.) Need to make sure that if someone wants to follow the Haddock source-code link to (say) Functor, they should still find it regardless of where it is actually defined.
118
-
119
-
- We could consider issuing a warning if you say ``-package ghc-internals`` (or ``ghc-bignum`` or ``ghc-prim``), one that was hard to silence.
120
-
Since we can have module-level ``WARNING`` pragmas with custom categories, one way to realise this would be to pick a category and add such pragmas to every module in the relevant packages, though we might want to do something more systematic.
121
-
The text of the warnings could encourage users to
122
-
123
-
- switch to a function exposed by base, and/or
124
-
- petition the CLC to expose this super-useful function from base.
125
-
126
-
- ``cabal check`` (a per-package check) could warn on packages that use ``ghc-internals``.
127
-
128
-
- ...what else?
110
+
Note: "discourage" does not imply "ban".
111
+
It must remain possible for hard-core developers to depend on `ghc-internals`.
112
+
Our goal is only that naive developers should not do so by accident.
129
113
130
114
- In contrast, clients are *not* discouraged from depending on ``ghc-experimental``; although again its name should convey the idea that it might change at short notice.
131
115
@@ -219,6 +203,31 @@ Moreover, they will help with CI for changes to GHC itself! (It is rather *more*
219
203
Discussion
220
204
==========
221
205
206
+
.. _discourage-brainstorm:
207
+
208
+
Discourging the (direct) use of ``ghc-internals``
209
+
-------------------------------------------------
210
+
211
+
Here are some ideas to be explored later for how to discorage the use of ``ghc-internals``.
212
+
213
+
- The name ``ghc-internals`` is a pretty strong signal all by itself.
214
+
215
+
- Cabal description and README explains how it is intended used (and not used).
216
+
217
+
- Hoogle could (by default anyway) never show stuff from ``ghc-internals``.
218
+
219
+
- Do not upload Haddocks for ``ghc-internals`` to Hackage.
220
+
(Ditto ``ghc-prim``.) Need to make sure that if someone wants to follow the Haddock source-code link to (say) Functor, they should still find it regardless of where it is actually defined.
221
+
222
+
- We could consider issuing a warning if you say ``-package ghc-internals`` (or ``ghc-bignum`` or ``ghc-prim``), one that was hard to silence.
223
+
Since we can have module-level ``WARNING`` pragmas with custom categories, one way to realise this would be to pick a category and add such pragmas to every module in the relevant packages, though we might want to do something more systematic.
224
+
The text of the warnings could encourage users to
225
+
226
+
- switch to a function exposed by base, and/or
227
+
- petition the CLC to expose this super-useful function from base.
228
+
229
+
- ``cabal check`` (a per-package check) could warn on packages that use ``ghc-internals``.
0 commit comments