module MkIface (
mkUsedNames,
mkDependencies,
- mkIface, -- Build a ModIface from a ModGuts,
- -- including computing version information
+ mkIface, -- Build a ModIface from a ModGuts,
+ -- including computing version information
mkIfaceTc,
- writeIfaceFile, -- Write the interface file
+ writeIfaceFile, -- Write the interface file
- checkOldIface, -- See if recompilation is required, by
- -- comparing version information
+ checkOldIface, -- See if recompilation is required, by
+ -- comparing version information
tyThingToIfaceDecl -- Converting things to their Iface equivalents
) where
\end{code}
- -----------------------------------------------
- Recompilation checking
- -----------------------------------------------
+ -----------------------------------------------
+ Recompilation checking
+ -----------------------------------------------
A complete description of how recompilation checking works can be
found in the wiki commentary:
import Finder
import DynFlags
import VarEnv
+import VarSet
import Var
import Name
import RdrName
ifFamInstTcName = ifaceTyConName . ifFamInstTyCon
- flattenVectInfo (VectInfo { vectInfoVar = vVar
- , vectInfoTyCon = vTyCon
+ flattenVectInfo (VectInfo { vectInfoVar = vVar
+ , vectInfoTyCon = vTyCon
+ , vectInfoScalarVars = vScalarVars
+ , vectInfoScalarTyCons = vScalarTyCons
}) =
- IfaceVectInfo {
- ifaceVectInfoVar = [ Var.varName v
- | (v, _) <- varEnvElts vVar],
- ifaceVectInfoTyCon = [ tyConName t
- | (t, t_v) <- nameEnvElts vTyCon
- , t /= t_v],
- ifaceVectInfoTyConReuse = [ tyConName t
- | (t, t_v) <- nameEnvElts vTyCon
- , t == t_v]
+ IfaceVectInfo
+ { ifaceVectInfoVar = [Var.varName v | (v, _ ) <- varEnvElts vVar]
+ , ifaceVectInfoTyCon = [tyConName t | (t, t_v) <- nameEnvElts vTyCon, t /= t_v]
+ , ifaceVectInfoTyConReuse = [tyConName t | (t, t_v) <- nameEnvElts vTyCon, t == t_v]
+ , ifaceVectInfoScalarVars = [Var.varName v | v <- varSetElems vScalarVars]
+ , ifaceVectInfoScalarTyCons = nameSetToList vScalarTyCons
}
-----------------------------
(sel_tyvars, rho_ty) = splitForAllTys (idType sel_id)
op_ty = funResultTy rho_ty
- toDmSpec NoDefMeth = NoDM
- toDmSpec GenDefMeth = GenericDM
- toDmSpec (DefMeth _) = VanillaDM
+ toDmSpec NoDefMeth = NoDM
+ toDmSpec (GenDefMeth _) = GenericDM
+ toDmSpec (DefMeth _) = VanillaDM
toIfaceFD (tvs1, tvs2) = (map getFS tvs1, map getFS tvs2)
ifCons = ifaceConDecls (algTyConRhs tycon),
ifRec = boolToRecFlag (isRecursiveTyCon tycon),
ifGadtSyntax = isGadtSyntaxTyCon tycon,
- ifGeneric = tyConHasGenerics tycon,
ifFamInst = famInstToIface (tyConFamInst_maybe tycon)}
| isForeignTyCon tycon