Skip to content

Commit ebf55b1

Browse files
committed
Wibbles
1 parent 80780ad commit ebf55b1

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

proposals/0000-ghc-module-naming.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ Background and motivation
77
The accepted `Proposal #51: GHC base libraries <https://github.com/haskellfoundation/tech-proposals/blob/main/proposals/accepted/051-ghc-base-libraries.rst>`_
88
defines the following libraries:
99

10-
* ``base``: the foundational library on which the rest of the ecosystem is based. Is API is carefully curated by the `Core Libraries Committee <https://github.com/haskell/core-libraries-committee>`_, and is kept rather stable.
10+
* ``base``: the foundational library on which the rest of the ecosystem is based.
11+
12+
* Its API is carefully curated by the `Core Libraries Committee <https://github.com/haskell/core-libraries-committee>`_, and is kept rather stable.
1113

1214
* ``ghc-experimental``: the home of experimental extensions to GHC, usually ones proposed by the
1315
`GHC Steering Committee <https://github.com/ghc-proposals/ghc-proposals/>`_.
16+
1417
* 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`.
18+
1519
* It is user-facing (user are encouraged to depend on it), but its API is less stable than ``base``.
1620

1721
* ``ghc-prim, ghc-internals`` (and perhaps others): define functions and data types used internally by GHC to support the API of ``base`` and ``ghc-experimental``.
@@ -30,10 +34,11 @@ help us design module names.
3034
The proposal
3135
============
3236

33-
This proposal is split into four for easier discussion. Each sub-proposal builds on the
37+
This proposal is split into four sub-proposals for easier discussion. Each sub-proposal builds on the
3438
earlier ones -- they are increments, not alternatives.
3539

36-
The goals of this proposal are deliberately limited to establish naming conventions. We propose no new mechanisms.
40+
The goals of this proposal are deliberately limited to establish naming conventions. We do not propose
41+
any changes to ``ghc`` or to ``cabal``.
3742

3843
Proposal 1
3944
-----------
@@ -61,9 +66,9 @@ Proposal 3
6166
The current ``base`` API exposes many modules starting with ``GHC.*``, so the proposed conventions could only
6267
apply to *new* modules.
6368

64-
* Over time, and with the agreement and support of the Core Libraries Committee, we may remove some ``GHC.*`` modules
69+
* Over time, and only with the agreement and support of the Core Libraries Committee, we may remove some ``GHC.*`` modules
6570
from ``base``, especially ones that are barely used, or are manifestly "internal" (i.e. part of the implementation
66-
of other, more public functions.
71+
of other, more public functions).
6772
Of course there would be a significant deprecation cycle, to allow client libraries to adapt.
6873

6974
Proposal 3 only expresses a direction of travel. We will have to see what the CLC's attitude is,
@@ -99,6 +104,7 @@ That would have made it clear that the design of overloaded records still evolvi
99104
Once the design becomes settled and stable, it could move to ``base``, perhaps in a module like ``Data.Records``.
100105

101106
Other similar examples include
107+
102108
* The tuple proposal of `GHC Proposal 475 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst>`_
103109
* The `DataToTag CLC proposal <https://github.com/haskell/core-libraries-committee/issues/104>`_ would have been easier to expose through ``ghc-experimental`` in the first instance.
104110

@@ -109,21 +115,23 @@ Alternatives
109115
the module moves from ``ghc-experimental`` to ``base``. For example, we might add ``Data.Tuple`` to ``ghc-experimental`` containing the new type constructors ``Tuple2``, ``Tuple3`` etc that are proposed in `GHC Proposal 475 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0475-tuple-syntax.rst>`_. However:
110116

111117
* 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``.
112-
* It loses the explicit cue given by ``import Experimental.Data.Tuple``.
118+
* It loses the explicit cue, in the source code, given by ``import Experimental.Data.Tuple``.
113119

114120
* We could use ``GHC.*`` for modules in ``ghc-experimental``, and maybe ``GHC.Internals.*`` for module in ``ghc-internals``. But
115121

116122
* There are two sorts of GHC-specific-ness to consider:
123+
117124
* Modules that are part of GHC's implementations
118125
* Modules that support a GHC extension, blessed by the GHC Steering Committee
119126

120127
It is worth distinguishing these: it's confusing if both start with ``GHC.``.
121128

122129
* It would be a huge upheaval (with impact on users) to rename hundreds of modules in ``ghc-internals``.
123130

124-
* We could use ``GHC.Experimental.*`` for modules in ``ghc-experimental``. But that seems a bit backwards: ``GHC.Tuple`` (in ``ghc-internals``) would look more stable (less experimental) than ``GHC.Experimental.Tuple`` in ``ghc-experimental``; but the reverse is the case.
131+
* We could use ``GHC.Experimental.*`` for modules in ``ghc-experimental``. But that seems a bit backwards: ``GHC.Tuple`` (in ``ghc-internals``) would superficially appear more stable (less experimental) than ``GHC.Experimental.Tuple`` in ``ghc-experimental``; but the reverse is the case.
125132

126133
* We could use a suffix ``*.Internals`` or ``*.Experimental`` instead of a prefix. But
134+
127135
* This sort of naming is conventionally used to distinguish modules *within* a package, not *between* packages.
128136
* It would still suffer from the cost of renaming hundreds of modules in ``ghc-internals``
129137

0 commit comments

Comments
 (0)