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
* Functions and types in here are usually candidates for later transfer into ``base``. But not necessarily: if a collection of functions is not adopted widely enough, it may not be proposed for a move to `base`. Or it could move to another library entirely.
23
23
@@ -28,6 +28,7 @@ defines the following libraries:
28
28
* Likely to have a major version bump with each GHC release.
* Define functions and data types used internally by GHC to support the API of ``base`` and ``ghc-experimental``.
32
33
33
34
* These libraries come with no stability guarantees: they may change at short notice.
@@ -70,10 +71,11 @@ Proposal 2
70
71
So example we might have
71
72
72
73
* ``GHC.Internal.Bits`` in ``ghc-internal``,
73
-
* ``Data.Bits.Experimental`` in ``ghc-experimental``
74
+
* ``Data.Bits.Experimental`` in ``ghc-experimental``a
74
75
* ``Data.Bits``, and currently also ``GHC.Bits``, in ``base``
75
76
76
77
Why ``GHC.Internal.*`` for modules in ``ghc-internal``? Would ``GHC.*`` not be enough? Here's why:
78
+
77
79
* ``base`` already has ``GHC.Bits``, and Proposal 1 stops us re-using the same module name in ``ghc-internal``.
78
80
If we were starting from a blank sheet of paper we might have no ``GHC.*`` modules in ``base``, but there
79
81
curently 138 such modules and it seems unlikely that we will ever remove all, or even most, of them from
@@ -87,6 +89,7 @@ implementation matter.
87
89
88
90
Using a prefix for ``ghc-internal`` and a suffix for ``ghc-experimental`` may seem inconsistent,
89
91
but it was a clear consensus from the discussion about the proposal:
92
+
90
93
* ``Data.Tuple.Experimental``, for example, is an companion/extension of ``Data.Tuple``; some exports may move from one to the other. Many developers sort their imports alphabetically. Making this a suffix means all ``Data.Tuple``-related imports are next to each other. For example, one might prefer this::
91
94
92
95
import Control.Applicative
@@ -144,8 +147,7 @@ a random fuction whose name or type, or very existence, might change without war
144
147
* The public API of package ``ghc`` (GHC as a library) should have modules whose names clearly distinguish them
145
148
from internal modules.
146
149
147
-
For example, the public API could have modules of form ``GhcAPI.*``, or ``GHC.API.*``, or something else.
148
-
The specifica are a matter for the future GHC API working group.
150
+
For example, the public API could have modules of form ``GhcAPI.*``, or ``GHC.API.*``, or ``Language.Haskell.GHC.*`` or something else. The specifics are a matter for the future GHC API working group.
149
151
150
152
151
153
@@ -180,28 +182,3 @@ Alternatives
180
182
* In the meantime there are two modules both called ``Data.Tuple``. This is bad. Which one does ``import Data.Tuple`` import? (Look at the Cabal file, perhaps?) How can I import both? (Package-qualified imports perhaps.) So it will really only help in the case of a brand-new module, not already in ``base``.
181
183
* It loses the explicit cue, in the source code, given by ``import Experimental.Data.Tuple``.
182
184
183
-
* We could use ``GHC.*`` for modules in ``ghc-experimental``, and maybe ``GHC.Internals.*`` for module in ``ghc-internal``. But
184
-
185
-
* There are two sorts of GHC-specific-ness to consider:
186
-
187
-
* Modules that are part of GHC's implementations
188
-
* Modules that support a GHC extension, blessed by the GHC Steering Committee
189
-
190
-
It is worth distinguishing these: it's confusing if both start with ``GHC.``.
191
-
192
-
* It would be a huge upheaval (with impact on users) to rename hundreds of modules in ``ghc-internal``.
193
-
194
-
* We could use ``GHC.Experimental.*`` for modules in ``ghc-experimental``. But that seems a bit backwards: ``GHC.Tuple`` (in ``ghc-internal``) would superficially appear more stable (less experimental) than ``GHC.Experimental.Tuple`` in ``ghc-experimental``; but the reverse is the case.
195
-
196
-
* We could use a suffix ``*.Internals`` or ``*.Experimental`` instead of a prefix. But
197
-
198
-
* This sort of naming is often used to distinguish modules *within* a package, not *between* packages.
199
-
* In the case of ``ghc-internal`` it would still suffer from the cost of renaming hundreds of modules.
200
-
201
-
* Concerning Proposal 4, we could instead use
202
-
203
-
* ``GHC.API`` (but then the public namespace is inside the internal one)
0 commit comments