summaryrefslogtreecommitdiff
path: root/compiler/iface/TcIface.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/iface/TcIface.hs')
-rw-r--r--compiler/iface/TcIface.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs
index c0b84640b0..e08a3d71f6 100644
--- a/compiler/iface/TcIface.hs
+++ b/compiler/iface/TcIface.hs
@@ -177,6 +177,9 @@ typecheckIface iface
-- Exports
; exports <- ifaceExportNames (mi_exports iface)
+ -- Complete Sigs
+ ; complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
+
-- Finished
; traceIf (vcat [text "Finished typechecking interface for" <+> ppr (mi_module iface),
-- Careful! If we tug on the TyThing thunks too early
@@ -190,6 +193,7 @@ typecheckIface iface
, md_anns = anns
, md_vect_info = vect_info
, md_exports = exports
+ , md_complete_sigs = complete_sigs
}
}
@@ -327,6 +331,7 @@ typecheckIfacesForMerging mod ifaces tc_env_var =
anns <- tcIfaceAnnotations (mi_anns iface)
vect_info <- tcIfaceVectInfo (mi_semantic_module iface) type_env (mi_vect_info iface)
exports <- ifaceExportNames (mi_exports iface)
+ complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
return $ ModDetails { md_types = type_env
, md_insts = insts
, md_fam_insts = fam_insts
@@ -334,6 +339,7 @@ typecheckIfacesForMerging mod ifaces tc_env_var =
, md_anns = anns
, md_vect_info = vect_info
, md_exports = exports
+ , md_complete_sigs = complete_sigs
}
return (global_type_env, details)
@@ -366,6 +372,7 @@ typecheckIfaceForInstantiate nsubst iface =
anns <- tcIfaceAnnotations (mi_anns iface)
vect_info <- tcIfaceVectInfo (mi_semantic_module iface) type_env (mi_vect_info iface)
exports <- ifaceExportNames (mi_exports iface)
+ complete_sigs <- tcIfaceCompleteSigs (mi_complete_sigs iface)
return $ ModDetails { md_types = type_env
, md_insts = insts
, md_fam_insts = fam_insts
@@ -373,6 +380,7 @@ typecheckIfaceForInstantiate nsubst iface =
, md_anns = anns
, md_vect_info = vect_info
, md_exports = exports
+ , md_complete_sigs = complete_sigs
}
-- Note [Resolving never-exported Names in TcIface]
@@ -1016,6 +1024,21 @@ tcIfaceAnnTarget (ModuleTarget mod) = do
{-
************************************************************************
* *
+ Complete Match Pragmas
+* *
+************************************************************************
+-}
+
+tcIfaceCompleteSigs :: [IfaceCompleteMatch] -> IfL [CompleteMatch]
+tcIfaceCompleteSigs = mapM tcIfaceCompleteSig
+
+tcIfaceCompleteSig :: IfaceCompleteMatch -> IfL CompleteMatch
+tcIfaceCompleteSig (IfaceCompleteMatch ms t) =
+ CompleteMatch <$> (mapM tcIfaceConLike ms) <*> tcIfaceTyConByName t
+
+{-
+************************************************************************
+* *
Vectorisation information
* *
************************************************************************
@@ -1668,6 +1691,14 @@ tcIfaceDataCon name = do { thing <- tcIfaceGlobal name
AConLike (RealDataCon dc) -> return dc
_ -> pprPanic "tcIfaceExtDC" (ppr name$$ ppr thing) }
+tcIfaceConLike :: Name -> IfL ConLike
+tcIfaceConLike name =
+ do { thing <- tcIfaceGlobal name
+ ; case thing of
+ AConLike cl -> return cl
+ _ -> pprPanic "tcIfaceExtCL" (ppr name$$ ppr thing) }
+
+
tcIfaceExtId :: Name -> IfL Id
tcIfaceExtId name = do { thing <- tcIfaceGlobal name
; case thing of