X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcInstDcls.lhs;h=14621791608209aa19b439ed1790c3856c08633f;hb=1cf00bfef1c35b89c21d1eaa9f6be7354a40f016;hp=68b9106df35171432854f65800be58cb0fb3729f;hpb=83f16ade9edf272c88c6b2ed8b8e951b905fe130;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs index 68b9106..1462179 100644 --- a/compiler/typecheck/TcInstDcls.lhs +++ b/compiler/typecheck/TcInstDcls.lhs @@ -206,7 +206,7 @@ Just . Instead, we simply rely on the fact that casts are cheap: $df :: forall a. C a => C [a] - {-# INLINE df #} -- NB: INLINE this + {-# INLINE df #-} -- NB: INLINE this $df = /\a. \d. MkC [a] ($cop_list a d) = $cop_list |> forall a. C a -> (sym (Co:C [a])) @@ -370,7 +370,6 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls ; let { (local_info, at_tycons_s) = unzip local_info_tycons ; at_idx_tycons = concat at_tycons_s ++ idx_tycons - ; clas_decls = filter (isClassDecl . unLoc) tycl_decls ; implicit_things = concatMap implicitTyThings at_idx_tycons ; aux_binds = mkRecSelBinds at_idx_tycons } @@ -379,26 +378,22 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls -- tythings to the global environment ; tcExtendGlobalEnv (at_idx_tycons ++ implicit_things) $ do { - -- (3) Instances from generic class declarations - ; generic_inst_info <- getGenericInstances clas_decls -- Next, construct the instance environment so far, consisting -- of -- (a) local instance decls - -- (b) generic instances - -- (c) local family instance decls + -- (b) local family instance decls ; addInsts local_info $ - addInsts generic_inst_info $ addFamInsts at_idx_tycons $ do { - -- (4) Compute instances from "deriving" clauses; + -- (3) Compute instances from "deriving" clauses; -- This stuff computes a context for the derived instance -- decl, so it needs to know about all the instances possible -- NB: class instance declarations can contain derivings as -- part of associated data type declarations - failIfErrsM -- If the addInsts stuff gave any errors, don't - -- try the deriving stuff, because that may give - -- more errors still + failIfErrsM -- If the addInsts stuff gave any errors, don't + -- try the deriving stuff, because that may give + -- more errors still ; (deriv_inst_info, deriv_binds, deriv_dus, deriv_tys, deriv_ty_insts) <- tcDeriving tycl_decls inst_decls deriv_decls @@ -407,9 +402,8 @@ tcInstDecls1 tycl_decls inst_decls deriv_decls ; gbl_env <- addFamInsts (map ATyCon deriv_ty_insts) $ tcExtendGlobalEnv (map ATyCon (deriv_tys ++ deriv_ty_insts)) $ addInsts deriv_inst_info getGblEnv --- ; traceTc "Generic deriving" (vcat (map pprInstInfo deriv_inst_info)) - ; return ( addTcgDUs gbl_env deriv_dus, - generic_inst_info ++ deriv_inst_info ++ local_info, + ; return ( addTcgDUs gbl_env deriv_dus, + deriv_inst_info ++ local_info, aux_binds `plusHsValBinds` deriv_binds) }}}