Skip to content

Commit 81294bc

Browse files
committed
More wibbles
1 parent 21642a7 commit 81294bc

File tree

1 file changed

+6
-29
lines changed

1 file changed

+6
-29
lines changed

proposals/0000-ghc-module-naming.rst

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defines the following libraries:
1717
* ``ghc-experimental``:
1818

1919
* The home of experimental extensions to GHC, usually ones proposed by the
20-
`GHC Steering Committee <https://github.com/ghc-proposals/ghc-proposals/>`_.
20+
`GHC Steering Committee <https://github.com/ghc-proposals/ghc-proposals/>`_.
2121

2222
* 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.
2323

@@ -28,6 +28,7 @@ defines the following libraries:
2828
* Likely to have a major version bump with each GHC release.
2929

3030
* ``ghc-prim, ghc-internal`` (and perhaps others; it's an internal GHC implementation decision):
31+
3132
* Define functions and data types used internally by GHC to support the API of ``base`` and ``ghc-experimental``.
3233

3334
* These libraries come with no stability guarantees: they may change at short notice.
@@ -70,10 +71,11 @@ Proposal 2
7071
So example we might have
7172

7273
* ``GHC.Internal.Bits`` in ``ghc-internal``,
73-
* ``Data.Bits.Experimental`` in ``ghc-experimental``
74+
* ``Data.Bits.Experimental`` in ``ghc-experimental``a
7475
* ``Data.Bits``, and currently also ``GHC.Bits``, in ``base``
7576

7677
Why ``GHC.Internal.*`` for modules in ``ghc-internal``? Would ``GHC.*`` not be enough? Here's why:
78+
7779
* ``base`` already has ``GHC.Bits``, and Proposal 1 stops us re-using the same module name in ``ghc-internal``.
7880
If we were starting from a blank sheet of paper we might have no ``GHC.*`` modules in ``base``, but there
7981
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.
8789

8890
Using a prefix for ``ghc-internal`` and a suffix for ``ghc-experimental`` may seem inconsistent,
8991
but it was a clear consensus from the discussion about the proposal:
92+
9093
* ``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::
9194

9295
import Control.Applicative
@@ -144,8 +147,7 @@ a random fuction whose name or type, or very existence, might change without war
144147
* The public API of package ``ghc`` (GHC as a library) should have modules whose names clearly distinguish them
145148
from internal modules.
146149

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.
149151

150152

151153

@@ -180,28 +182,3 @@ Alternatives
180182
* 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``.
181183
* It loses the explicit cue, in the source code, given by ``import Experimental.Data.Tuple``.
182184

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)
204-
* ``GHCAPI``
205-
* ``GHCapi``
206-
* ``Language.Haskell.GHC`` or ``Language.GHC``
207-

0 commit comments

Comments
 (0)