-tcModule :: RnEnv -- for renaming derivings
- -> RenamedHsModule -- input
- -> TcM s ((TypecheckedHsBinds, -- record selector binds
- TypecheckedHsBinds, -- binds from class decls; does NOT
- -- include default-methods bindings
- TypecheckedHsBinds, -- binds from instance decls; INCLUDES
- -- class default-methods binds
- TypecheckedHsBinds, -- binds from value decls
-
- [(Id, TypecheckedHsExpr)]), -- constant instance binds
-
- ([RenamedFixityDecl], [Id], [TyCon], [Class], Bag InstInfo),
- -- things for the interface generator
-
- ([TyCon], [Class]),
- -- environments of info from this module only
-
- FiniteMap TyCon [(Bool, [Maybe Type])],
- -- source tycon specialisation requests
+-- Convenient type synonyms first:
+type TcResults
+ = (TcResultBinds,
+ TcIfaceInfo,
+ TcSpecialiseRequests,
+ TcDDumpDeriv)
+
+type TcResultBinds
+ = (TypecheckedHsBinds, -- record selector binds
+ TypecheckedHsBinds, -- binds from class decls; does NOT
+ -- include default-methods bindings
+ TypecheckedHsBinds, -- binds from instance decls; INCLUDES
+ -- class default-methods binds
+ TypecheckedHsBinds, -- binds from value decls
+
+ [(Id, TypecheckedHsExpr)]) -- constant instance binds
+
+type TcIfaceInfo -- things for the interface generator
+ = ([Id], [TyCon], [Class], Bag InstInfo)
+
+type TcSpecialiseRequests
+ = FiniteMap TyCon [(Bool, [Maybe Type])]
+ -- source tycon specialisation requests
+
+type TcDDumpDeriv
+ = PprStyle -> Pretty
+
+---------------
+typecheckModule
+ :: UniqSupply
+ -> RnEnv -- for renaming derivings
+ -> RenamedHsModule
+ -> MaybeErr
+ (TcResults, -- if all goes well...
+ Bag Warning) -- (we can still get warnings)
+ (Bag Error, -- if we had errors...
+ Bag Warning)
+
+typecheckModule us rn_env mod
+ = initTc us (tcModule rn_env mod)
+\end{code}