-- pragmas, which is done lazily [ie failure just drops the pragma
-- without having any global-failure effect].
-- pragmas, which is done lazily [ie failure just drops the pragma
-- without having any global-failure effect].
fixTc (\ ~(_, _, _, _, _, _, sig_ids) ->
fixTc (\ ~(_, _, _, _, _, _, sig_ids) ->
buildInstanceEnvs inst_info `thenTc` \ inst_mapper ->
returnTc (inst_mapper, env, inst_info, deriv_binds, ddump_deriv)
) `thenTc` \ (_, env, inst_info, deriv_binds, ddump_deriv) ->
buildInstanceEnvs inst_info `thenTc` \ inst_mapper ->
returnTc (inst_mapper, env, inst_info, deriv_binds, ddump_deriv)
) `thenTc` \ (_, env, inst_info, deriv_binds, ddump_deriv) ->
-- we silently discard the pragma
tcInterfaceSigs sigs `thenTc` \ sig_ids ->
tcGetEnv `thenNF_Tc` \ env ->
-- we silently discard the pragma
tcInterfaceSigs sigs `thenTc` \ sig_ids ->
tcGetEnv `thenNF_Tc` \ env ->
returnTc (env, inst_info, data_binds, deriv_binds, ddump_deriv, defaulting_tys, sig_ids)
)))) `thenTc` \ (env, inst_info, data_binds, deriv_binds, ddump_deriv, defaulting_tys, _) ->
returnTc (env, inst_info, data_binds, deriv_binds, ddump_deriv, defaulting_tys, sig_ids)
)))) `thenTc` \ (env, inst_info, data_binds, deriv_binds, ddump_deriv, defaulting_tys, _) ->
(val_decls `ThenBinds` deriv_binds)
( -- Second pass over instance declarations,
-- to compile the bindings themselves.
(val_decls `ThenBinds` deriv_binds)
( -- Second pass over instance declarations,
-- to compile the bindings themselves.
tcInstDecls2 inst_info `thenNF_Tc` \ (lie_instdecls, inst_binds) ->
tcClassDecls2 cls_decls_bag `thenNF_Tc` \ (lie_clasdecls, cls_binds) ->
tcGetEnv `thenNF_Tc` \ env ->
tcInstDecls2 inst_info `thenNF_Tc` \ (lie_instdecls, inst_binds) ->
tcClassDecls2 cls_decls_bag `thenNF_Tc` \ (lie_clasdecls, cls_binds) ->
tcGetEnv `thenNF_Tc` \ env ->
-- restriction, and no subsequent decl instantiates its
-- type. (Usually, ambiguous type variables are resolved
-- during the generalisation step.)
-- restriction, and no subsequent decl instantiates its
-- type. (Usually, ambiguous type variables are resolved
-- during the generalisation step.)
tcSimplifyTop lie_alldecls `thenTc` \ const_insts ->
-- Backsubstitution. Monomorphic top-level decls may have
tcSimplifyTop lie_alldecls `thenTc` \ const_insts ->
-- Backsubstitution. Monomorphic top-level decls may have