Fix names of coercions in newtype instances
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 27 Jun 2007 09:42:00 +0000 (09:42 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 27 Jun 2007 09:42:00 +0000 (09:42 +0000)
- Thanks to Roman for spotting the problem.

compiler/basicTypes/MkId.lhs
compiler/basicTypes/OccName.lhs
compiler/typecheck/TcTyClsDecls.lhs

index 535faef..f72afb9 100644 (file)
@@ -72,7 +72,7 @@ import Outputable
 import FastString
 import ListSetOps
 import Module
 import FastString
 import ListSetOps
 import Module
-\end{code}             
+\end{code}
 
 %************************************************************************
 %*                                                                     *
 
 %************************************************************************
 %*                                                                     *
index 8de65b8..bc11cbd 100644 (file)
@@ -445,7 +445,7 @@ mkIPOcc                 = mk_simple_deriv varName  "$i"
 mkSpecOcc          = mk_simple_deriv varName  "$s"
 mkForeignExportOcc  = mk_simple_deriv varName  "$f"
 mkNewTyCoOcc        = mk_simple_deriv tcName  ":Co"
 mkSpecOcc          = mk_simple_deriv varName  "$s"
 mkForeignExportOcc  = mk_simple_deriv varName  "$f"
 mkNewTyCoOcc        = mk_simple_deriv tcName  ":Co"
-mkInstTyCoOcc       = mk_simple_deriv tcName  ":Co"      -- derived from rep ty
+mkInstTyCoOcc       = mk_simple_deriv tcName  ":CoF"     -- derived from rep ty
 mkEqPredCoOcc      = mk_simple_deriv tcName  "$co"
 
 -- Generic derivable classes
 mkEqPredCoOcc      = mk_simple_deriv tcName  "$co"
 
 -- Generic derivable classes
index 49425a4..191e546 100644 (file)
@@ -314,7 +314,7 @@ tcFamInstDecl1 (decl@TyData {tcdND = new_or_data, tcdLName = L loc tc_name,
                 case new_or_data of
                   DataType -> return (mkDataTyConRhs data_cons)
                   NewType  -> ASSERT( isSingleton data_cons )
                 case new_or_data of
                   DataType -> return (mkDataTyConRhs data_cons)
                   NewType  -> ASSERT( isSingleton data_cons )
-                              mkNewTyConRhs tc_name tycon (head data_cons)
+                              mkNewTyConRhs rep_tc_name tycon (head data_cons)
             ; buildAlgTyCon rep_tc_name t_tvs stupid_theta tc_rhs Recursive
                             False h98_syntax (Just (family, t_typats))
                  -- We always assume that indexed types are recursive.  Why?
             ; buildAlgTyCon rep_tc_name t_tvs stupid_theta tc_rhs Recursive
                             False h98_syntax (Just (family, t_typats))
                  -- We always assume that indexed types are recursive.  Why?