X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcDeriv.lhs;h=3974bf001500c8df66d0885fea1811aa590e1ff2;hb=e0dc0bc87a534b5a0329d3544c408c5f32d129a4;hp=36b980f4084bebc24e4154fb1add443ece9686fb;hpb=ac733aa2809d6352533e33fb559bbe459cbf5182;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcDeriv.lhs b/ghc/compiler/typecheck/TcDeriv.lhs index 36b980f..3974bf0 100644 --- a/ghc/compiler/typecheck/TcDeriv.lhs +++ b/ghc/compiler/typecheck/TcDeriv.lhs @@ -206,10 +206,10 @@ And then translate it to: \begin{code} tcDeriving :: [LTyClDecl Name] -- All type constructors -> TcM ([InstInfo], -- The generated "instance decls" - [HsBindGroup Name]) -- Extra generated top-level bindings + HsValBinds Name) -- Extra generated top-level bindings tcDeriving tycl_decls - = recoverM (returnM ([], [])) $ + = recoverM (returnM ([], emptyValBindsOut)) $ do { -- Fish the "deriving"-related information out of the TcEnv -- and make the necessary "equations". overlap_flag <- getOverlapFlag @@ -227,7 +227,7 @@ tcDeriving tycl_decls -- don't generate any derived bindings ; is_boot <- tcIsHsBoot ; if is_boot then - return (inst_info, []) + return (inst_info, emptyValBindsOut) else do { @@ -239,11 +239,11 @@ tcDeriving tycl_decls -- which is used in the generic binds ; rn_binds <- discardWarnings $ setOptM Opt_GlasgowExts $ do - { (rn_deriv, _dus1) <- rnTopBinds deriv_binds [] - ; (rn_gen, dus_gen) <- rnTopBinds gen_binds [] + { (rn_deriv, _dus1) <- rnTopBinds (ValBindsIn deriv_binds []) + ; (rn_gen, dus_gen) <- rnTopBinds (ValBindsIn gen_binds []) ; keepAliveSetTc (duDefs dus_gen) -- Mark these guys to -- be kept alive - ; return (rn_deriv ++ rn_gen) } + ; return (rn_deriv `plusHsValBinds` rn_gen) } ; dflags <- getDOpts @@ -253,9 +253,9 @@ tcDeriving tycl_decls ; returnM (inst_info, rn_binds) }} where - ddump_deriving :: [InstInfo] -> [HsBindGroup Name] -> SDoc + ddump_deriving :: [InstInfo] -> HsValBinds Name -> SDoc ddump_deriving inst_infos extra_binds - = vcat (map pprInstInfoDetails inst_infos) $$ vcat (map ppr extra_binds) + = vcat (map pprInstInfoDetails inst_infos) $$ ppr extra_binds ----------------------------------------- deriveOrdinaryStuff overlap_flag [] -- Short cut @@ -625,7 +625,7 @@ cond_std (gla_exts, tycon) where data_cons = tyConDataCons tycon no_cons_why = quotes (ppr tycon) <+> ptext SLIT("has no data constructors") - existential_why = quotes (ppr tycon) <+> ptext SLIT("has existentially-quantified constructor(s)") + existential_why = quotes (ppr tycon) <+> ptext SLIT("has non-Haskell-98 constructor(s)") cond_isEnumeration :: Condition cond_isEnumeration (gla_exts, tycon)