Clarify situation surrounding GHC.Exts and friends
Currently there are three modules provided by ghc-prim which export GHC's primitive types and operations:
-
GHC.Primis deeply magical and provides primops and several primitive types -
GHC.Typesdefines other not-quite-so-primitive types -
GHC.Extsis supposed to be the user-facing interface for everything exported above
However, currently the status and stability of these modules is quite unclear to users. Moreover, historically not everything available in GHC.Types has been available via GHC.Exts (see #20695 (closed)).
We should clearly state that GHC.Prim and GHC.Types are not to be used directly by users and that they should rather use GHC.Exts.
Moveover, currently using GHC.Exts is unnecessarily difficult due to the immensity of its interface. I think we should rather split it up into several smaller modules. For instance:
-
GHC.Exts.SIMDexports the vector types and operations -
GHC.Exts.Arrayexports the array types and operations -
GHC.Exts.Intexports integer/word operations -
GHC.Exts.Ptrexports the raw pointer operations
Finally, GHC.Exts would simply export all of these modules. We would then want a check to ensure that everything provided by GHC.Prim and GHC.Types is exported from GHC.Exts.