[commit: ghc] master: Stable name type role (2287257)
git at git.haskell.org
git at git.haskell.org
Fri Oct 5 03:35:38 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/228725747c3e493c36d6b6ad1034ca56581cb758/ghc
>---------------------------------------------------------------
commit 228725747c3e493c36d6b6ad1034ca56581cb758
Author: David Feuer <david.feuer at gmail.com>
Date: Thu Oct 4 13:52:23 2018 -0400
Stable name type role
Make the `StableName#` parameter phantom:
There is actually never any reason to care about the type of
the underlying object of a `StableName#`. The underlying object
type shouldn't really even *be* a parameter. But at least we
can mark it as phantom.
Reviewers: hvr, bgamari, erikd, simonmar
Reviewed By: simonmar
Subscribers: ekmett, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5117
>---------------------------------------------------------------
228725747c3e493c36d6b6ad1034ca56581cb758
compiler/prelude/TysPrim.hs | 2 +-
docs/users_guide/8.8.1-notes.rst | 8 ++++++++
libraries/base/changelog.md | 4 ++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs
index c5af4a5..4a69df8 100644
--- a/compiler/prelude/TysPrim.hs
+++ b/compiler/prelude/TysPrim.hs
@@ -943,7 +943,7 @@ mkStablePtrPrimTy ty = TyConApp stablePtrPrimTyCon [ty]
-}
stableNamePrimTyCon :: TyCon
-stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName [Representational] UnliftedRep
+stableNamePrimTyCon = pcPrimTyCon stableNamePrimTyConName [Phantom] UnliftedRep
mkStableNamePrimTy :: Type -> Type
mkStableNamePrimTy ty = TyConApp stableNamePrimTyCon [ty]
diff --git a/docs/users_guide/8.8.1-notes.rst b/docs/users_guide/8.8.1-notes.rst
index 6bdde40..a27aee7 100644
--- a/docs/users_guide/8.8.1-notes.rst
+++ b/docs/users_guide/8.8.1-notes.rst
@@ -104,6 +104,10 @@ Template Haskell
eventlog events similar to ``traceBinaryEvent#`` but allows the user to pass
the event payload as a binary blob instead of a ``String``.
+- The ``StableName#`` type parameter now has a phantom role instead of
+ a representational one. There is really no reason to care about the
+ type of the underlying object.
+
``ghc`` library
~~~~~~~~~~~~~~~
@@ -114,6 +118,10 @@ Template Haskell
- Support the characters from recent versions of Unicode (up to v. 12) in literals
(see :ghc-ticket:`5518`).
+- The ``StableName`` type parameter now has a phantom role instead of
+ a representational one. There is really no reason to care about the
+ type of the underlying object.
+
Build system
~~~~~~~~~~~~
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 8964edd..3709a0a 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -6,6 +6,10 @@
* Support the characters from recent versions of Unicode (up to v. 12) in
literals (#5518).
+ * The `StableName` type parameter now has a phantom role instead of
+ a representational one. There is really no reason to care about the
+ type of the underlying object.
+
## 4.12.0.0 *TBA*
* Bundled with GHC *TBA*
More information about the ghc-commits
mailing list