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
The accepted `Proposal #51: GHC base libraries <https://github.com/haskellfoundation/tech-proposals/blob/main/proposals/accepted/051-ghc-base-libraries.rst>`_
8
9
defines the following libraries:
9
10
@@ -20,15 +21,18 @@ The question arises of what module names should be used. For example, suppose th
20
21
to use the package name in the ``import`` statement, to disambiguate. But it's *extremely* confusing. This proposal articulates a set of conventions to
21
22
help us design module names.
22
23
23
-
## The proposal
24
+
The proposal
25
+
============
24
26
25
-
### Proposal 1
27
+
Proposal 1
28
+
-----------
26
29
27
30
* Modules in ``base``, ``ghc-experimental``, ``ghc-prim``, ``ghc-internals`` etc should all have distinct names.
28
31
29
32
That principle leads immediately to the question: what should those names be? Hence proposal 2.
30
33
31
-
### Proposal 2
34
+
Proposal 2
35
+
-----------
32
36
33
37
* Modules in GHC's internal libraries (``ghc-prim``, ``ghc-internals`` etc) should be of form ``GHC.*``.
34
38
* Modules in ``ghc-experimental`` should be of form ``Experimental.*``.
@@ -39,7 +43,8 @@ So example we might have
39
43
* ``Experimental.Tuple`` or ``Experimental.Data.Tuple`` in ``ghc-experimental``
40
44
* ``Data.Tuple`` in ``base``
41
45
42
-
### Proposal 3
46
+
Proposal 3
47
+
-----------
43
48
44
49
The current ``base`` API exposes many modules starting with ``GHC.*``, so the proposed conventions could only
45
50
apply to *new* modules.
@@ -48,8 +53,8 @@ apply to *new* modules.
48
53
from ``base``, either exposing their desired API through a stable, CLC-curated, module in ``base``; or removing it altogether. Of course
49
54
there would be a significant deprecation cycle, to allow client libraries to adapt.
50
55
51
-
### Alternatives
52
-
56
+
Alternatives
57
+
==============
53
58
* We could use ``GHC.*`` for modules in ``ghc-experimental``, and maybe ``GHC.Internals.*`` for module in ``ghc-internals``. But
54
59
55
60
* There are two sorts of GHC-specific-ness to consider:
@@ -64,8 +69,8 @@ apply to *new* modules.
64
69
* This sort of naming is conventionally used to distinguish modules *within* a package, not *between* packages.
65
70
* It would still suffer from the cost of renaming hundreds of modules in ``ghc-internals``
66
71
67
-
### Discussion
68
-
72
+
Discussion
73
+
============
69
74
What should we do about the ``ghc`` package, which exposes GHC as a library, through the GHC API?
70
75
It wouldn't really make sense to call it ``Experimental.*``. And yet, under the above proposals, ``GHC.*`` connotes
71
76
"internal, unstable" which should not be true of the GHC API (although it is today).
0 commit comments