diff options
author | Jose Pedro Magalhaes <jpm@cs.uu.nl> | 2011-11-04 08:41:52 +0000 |
---|---|---|
committer | Jose Pedro Magalhaes <jpm@cs.uu.nl> | 2011-11-04 08:42:22 +0000 |
commit | 76b5d7af3c6c916f9662c3b74182ccd4ae25977c (patch) | |
tree | a21abee2129801a5721f9f6780af90ec2314875d /compiler | |
parent | b41d625db9322fb9c8dfed3508773e3ed86136d6 (diff) | |
download | haskell-76b5d7af3c6c916f9662c3b74182ccd4ae25977c.tar.gz |
Improve -ddump-deriv output for Generic instances
Also print the right-hand side of the generated Rep
type instances.
Diffstat (limited to 'compiler')
-rwxr-xr-x[-rw-r--r--] | compiler/typecheck/TcDeriv.lhs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs index 1a7db7abf5..2c714efd52 100644..100755 --- a/compiler/typecheck/TcDeriv.lhs +++ b/compiler/typecheck/TcDeriv.lhs @@ -326,11 +326,7 @@ tcDeriving tycl_decls inst_decls deriv_decls ; dflags <- getDOpts ; liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Derived instances" - (ddump_deriving inst_info rn_binds newTyCons famInsts extraInstances)) -{- - ; when (not (null inst_info)) $ - dumpDerivingInfo (ddump_deriving inst_info rn_binds) --} + (ddump_deriving inst_info rn_binds newTyCons famInsts)) ; let all_tycons = map ATyCon (bagToList newTyCons) ; gbl_env <- tcExtendGlobalEnv all_tycons $ @@ -343,22 +339,18 @@ tcDeriving tycl_decls inst_decls deriv_decls ddump_deriving :: Bag (InstInfo Name) -> HsValBinds Name -> Bag TyCon -- ^ Empty data constructors -> Bag TyCon -- ^ Rep type family instances - -> Bag (InstInfo RdrName) - -- ^ Instances for the repMetaTys -> SDoc - ddump_deriving inst_infos extra_binds repMetaTys repTyCons metaInsts + ddump_deriving inst_infos extra_binds repMetaTys repTyCons = hang (ptext (sLit "Derived instances:")) 2 (vcat (map (\i -> pprInstInfoDetails i $$ text "") (bagToList inst_infos)) $$ ppr extra_binds) $$ hangP "Generic representation:" ( hangP "Generated datatypes for meta-information:" (vcat (map ppr (bagToList repMetaTys))) - -- The Outputable instance for TyCon unfortunately only prints the name... $$ hangP "Representation types:" - (vcat (map ppr (bagToList repTyCons))) - $$ hangP "Meta-information instances:" - (vcat (map pprInstInfoDetails (bagToList metaInsts)))) + (vcat (map pprTyFamInst (bagToList repTyCons)))) + pprTyFamInst t = ppr t <+> text "=" <+> ppr (synTyConType t) hangP s x = text "" $$ hang (ptext (sLit s)) 2 x |