Put liftStringName into the known-key names
[ghc-hetmet.git] / compiler / basicTypes / MkId.lhs
index 6e7b0c0..6d6a835 100644 (file)
@@ -218,10 +218,8 @@ It's a bit more complicated if the data instance is a GADT as well!
 
    data instance T [a] where
         T1 :: forall b. b -> T [Maybe b]
-Hence
-   Co7T a :: T [a] ~ :R7T a
 
-Now we want
+Hence we translate to
 
         -- Wrapper
   $WT1 :: forall b. b -> T [Maybe b]
@@ -231,6 +229,9 @@ Now we want
         -- Worker
   T1 :: forall c b. (c ~ Maybe b) => b -> :R7T c
 
+        -- Coercion from family type to representation type
+  Co7T a :: T [a] ~ :R7T a
+
 \begin{code}
 mkDataConIds :: Name -> Name -> DataCon -> DataConIds
 mkDataConIds wrap_name wkr_name data_con
@@ -920,11 +921,11 @@ unsafeCoerceId
     info = noCafIdInfo `setUnfoldingInfo` mkCompulsoryUnfolding rhs
            
 
-    ty  = mkForAllTys [openAlphaTyVar,openBetaTyVar]
-                      (mkFunTy openAlphaTy openBetaTy)
-    [x] = mkTemplateLocals [openAlphaTy]
-    rhs = mkLams [openAlphaTyVar,openBetaTyVar,x] $
-          Cast (Var x) (mkUnsafeCoercion openAlphaTy openBetaTy)
+    ty  = mkForAllTys [argAlphaTyVar,openBetaTyVar]
+                      (mkFunTy argAlphaTy openBetaTy)
+    [x] = mkTemplateLocals [argAlphaTy]
+    rhs = mkLams [argAlphaTyVar,openBetaTyVar,x] $
+          Cast (Var x) (mkUnsafeCoercion argAlphaTy openBetaTy)
 
 ------------------------------------------------
 nullAddrId :: Id
@@ -944,10 +945,10 @@ seqId = pcMiscPrelId seqName ty info
                        `setSpecInfo` mkSpecInfo [seq_cast_rule]
            
 
-    ty  = mkForAllTys [alphaTyVar,openBetaTyVar]
-                      (mkFunTy alphaTy (mkFunTy openBetaTy openBetaTy))
-    [x,y] = mkTemplateLocals [alphaTy, openBetaTy]
-    rhs = mkLams [alphaTyVar,openBetaTyVar,x,y] (Case (Var x) x openBetaTy [(DEFAULT, [], Var y)])
+    ty  = mkForAllTys [alphaTyVar,argBetaTyVar]
+                      (mkFunTy alphaTy (mkFunTy argBetaTy argBetaTy))
+    [x,y] = mkTemplateLocals [alphaTy, argBetaTy]
+    rhs = mkLams [alphaTyVar,argBetaTyVar,x,y] (Case (Var x) x argBetaTy [(DEFAULT, [], Var y)])
 
     -- See Note [Built-in RULES for seq]
     seq_cast_rule = BuiltinRule { ru_name  = fsLit "seq of cast"