summaryrefslogtreecommitdiff
path: root/compiler/prelude/TysPrim.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-09-26 15:02:09 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-09-26 15:06:16 +0100
commitc41ccbfa8aaeb99dd9a36cb3d99993f0fa039cdc (patch)
tree7d41a806727d1ce407802f8a5c475333418c1151 /compiler/prelude/TysPrim.hs
parent7446c7f68bd5addd2f2db0d8d5910fb963869c47 (diff)
downloadhaskell-c41ccbfa8aaeb99dd9a36cb3d99993f0fa039cdc.tar.gz
Omit Typeable from the "naturally coherent" list
In doing something else (Trac #14218) I tripped over the definition of "naturally coherent" classes. This patch - Cocuments properly what that means - Removes Typeable from the list, because now we know what it meams, Typeable clearly doesn't belong. No regressions. (Actually the term "naturally coherent" seems a bit off. More like "invertible" or something. But I left it.)
Diffstat (limited to 'compiler/prelude/TysPrim.hs')
-rw-r--r--compiler/prelude/TysPrim.hs31
1 files changed, 15 insertions, 16 deletions
diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs
index b4a5b6b541..5c099e845e 100644
--- a/compiler/prelude/TysPrim.hs
+++ b/compiler/prelude/TysPrim.hs
@@ -582,18 +582,17 @@ Note [The equality types story]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GHC sports a veritable menagerie of equality types:
- Hetero? Levity Result Role Defining module
- ------------------------------------------------------------
- ~# hetero unlifted # nominal GHC.Prim
- ~~ hetero lifted Constraint nominal GHC.Types
- ~ homo lifted Constraint nominal Data.Type.Equality
- :~: homo lifted * nominal Data.Type.Equality
-
- ~R# hetero unlifted # repr GHC.Prim
- Coercible homo lifted Constraint repr GHC.Types
- Coercion homo lifted * repr Data.Type.Coercion
-
- ~P# hetero unlifted phantom GHC.Prim
+ Built-in tc Hetero? Levity Result Role Defining module
+-----------------------------------------------------------------------------------------
+~# eqPrimTyCon hetero unlifted # nominal GHC.Prim
+~~ hEqTyCon hetero lifted Constraint nominal GHC.Types
+~ eqTyCon homo lifted Constraint nominal Data.Type.Equality
+:~: - homo lifted * nominal Data.Type.Equality
+
+~R# eqReprPrimTy hetero unlifted # repr GHC.Prim
+Coercible coercibleTyCon homo lifted Constraint repr GHC.Types
+Coercion - homo lifted * repr Data.Type.Coercion
+~P# eqPhantPrimTyCon hetero unlifted phantom GHC.Prim
Recall that "hetero" means the equality can related types of different
kinds. Knowing that (t1 ~# t2) or (t1 ~R# t2) or even that (t1 ~P# t2)
@@ -638,8 +637,8 @@ Here's what's unusual about it:
* It is "naturally coherent". This means that the solver won't hesitate to
solve a goal of type (a ~~ b) even if there is, say (Int ~~ c) in the
context. (Normally, it waits to learn more, just in case the given
- influences what happens next.) This is quite like having
- IncoherentInstances enabled.
+ influences what happens next.) See Note [Naturally coherent classes]
+ in TcInteract.
* It always terminates. That is, in the UndecidableInstances checks, we
don't worry if a (~~) constraint is too big, as we know that solving
@@ -666,8 +665,8 @@ This is even more so an ordinary class than (~~), with the following exceptions:
* It is "naturally coherent". (See (~~).)
- * (~) is magical syntax, as ~ is a reserved symbol. It cannot be exported
- or imported.
+ * (~) is magical syntax, as ~ is a reserved symbol.
+ It cannot be exported or imported.
* It always terminates.