Changes between Version 5 and Version 6 of TypeFunctionsIface
- Sep 12, 2006 12:17:56 AM (10 years ago)
v5 v6 5 5 The `IfaceSyn.IfaceData` variant of `IfaceDecl` contains a new `ifFamInst :: Maybe IfaceFamInst` field that is distinguishes ordinary data/newtype declarations from family instances. In the latter case, a `IfaceFamInst` value gives the instances head of the family instance. Moreover, all family instance heads of a module are collected in the new `mi_fam_insts :: [(IfaceFamInst, IfaceDecl)]` field of `HscTypes.ModIface`. We don't include the `IfaceDecl` component into `IfaceFamInst`, as we otherwise would get a cyclic dependency - the `IfaceDecl` must include `IfaceFamInst`, so that we can generate the correct wrapper signature for family data constructors during type checking the interface declarations. 6 6 7 The serialised interface description does not explicitly contain the value of `mi_fam_insts`. Instead, the `get` method of `Binary ModIface` (in `BinIface`) constructs the value on the fly. 7 The `mi_fam_insts` field does not contain any additional information, but instead is just a cached summary of the family instances of the `mi_decls` field. Hence, the serialised interface description does not explicitly contain the value of `mi_fam_insts`. Instead, the `get` method of `Binary ModIface` (in `BinIface`) - like all other places producing a `HscTypes.ModIface` - uses `HscTypes.mkIfaceFamInstsCache` to extract the relevant information from the declarations. 8 9 Similarly, `HscTypes.ModDetails` maintains a cached summary of the type checked representations of family instances in `md_fam_insts :: ![FamInstEnv.FamInst]`. This computed from teh field `md_types` with `HscTypes.mkDetailsFamInstsCache`.