Skip to content

Commit e50e2e9

Browse files
committed
Wibbles
1 parent c168ecf commit e50e2e9

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

proposals/0000-ghc-module-naming.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.. sectnum::
22

3-
# Module naming conventions for GHC base libraries
4-
5-
## Motivation
3+
Module naming conventions for GHC base libraries
4+
==================================================
65

6+
Motivation
7+
----------
78
The accepted `Proposal #51: GHC base libraries <https://github.com/haskellfoundation/tech-proposals/blob/main/proposals/accepted/051-ghc-base-libraries.rst>`_
89
defines the following libraries:
910

@@ -20,15 +21,18 @@ The question arises of what module names should be used. For example, suppose th
2021
to use the package name in the ``import`` statement, to disambiguate. But it's *extremely* confusing. This proposal articulates a set of conventions to
2122
help us design module names.
2223

23-
## The proposal
24+
The proposal
25+
============
2426

25-
### Proposal 1
27+
Proposal 1
28+
-----------
2629

2730
* Modules in ``base``, ``ghc-experimental``, ``ghc-prim``, ``ghc-internals`` etc should all have distinct names.
2831

2932
That principle leads immediately to the question: what should those names be? Hence proposal 2.
3033

31-
### Proposal 2
34+
Proposal 2
35+
-----------
3236

3337
* Modules in GHC's internal libraries (``ghc-prim``, ``ghc-internals`` etc) should be of form ``GHC.*``.
3438
* Modules in ``ghc-experimental`` should be of form ``Experimental.*``.
@@ -39,7 +43,8 @@ So example we might have
3943
* ``Experimental.Tuple`` or ``Experimental.Data.Tuple`` in ``ghc-experimental``
4044
* ``Data.Tuple`` in ``base``
4145

42-
### Proposal 3
46+
Proposal 3
47+
-----------
4348

4449
The current ``base`` API exposes many modules starting with ``GHC.*``, so the proposed conventions could only
4550
apply to *new* modules.
@@ -48,8 +53,8 @@ apply to *new* modules.
4853
from ``base``, either exposing their desired API through a stable, CLC-curated, module in ``base``; or removing it altogether. Of course
4954
there would be a significant deprecation cycle, to allow client libraries to adapt.
5055

51-
### Alternatives
52-
56+
Alternatives
57+
==============
5358
* We could use ``GHC.*`` for modules in ``ghc-experimental``, and maybe ``GHC.Internals.*`` for module in ``ghc-internals``. But
5459

5560
* There are two sorts of GHC-specific-ness to consider:
@@ -64,8 +69,8 @@ apply to *new* modules.
6469
* This sort of naming is conventionally used to distinguish modules *within* a package, not *between* packages.
6570
* It would still suffer from the cost of renaming hundreds of modules in ``ghc-internals``
6671

67-
### Discussion
68-
72+
Discussion
73+
============
6974
What should we do about the ``ghc`` package, which exposes GHC as a library, through the GHC API?
7075
It wouldn't really make sense to call it ``Experimental.*``. And yet, under the above proposals, ``GHC.*`` connotes
7176
"internal, unstable" which should not be true of the GHC API (although it is today).

0 commit comments

Comments
 (0)