6 Distinguish three kinds of things in interfaces:
8 - type, data, class, instance, value decls at top level
10 - the same but imported. Syntax
11 import B renaming C to D where
14 - imports, which serve just to attach original names
18 The third group are syntactically stuck at the beginning; the second two
23 Process each imported interface, and the implementation being compiled,
26 type, data and class decls (incl imported ones in interfaces)
28 giving the following environments for each
30 type/data info {(ModStr,TyConStr) -> arity}
31 class info {(ModStr,ClassStr)}
33 These are filtered (*but not renamed*) by the imports specified in the
34 impl (ignore dotdot parts and parts in parens), to give a grand
35 environment E1 of the same shape. It gives the original names of in-scope
40 Process each imported interface and the implementation being compiled:
42 - scan its imports and use them to filter and rename E1, to give
47 - scan type, data, class decls, headers of instance decls
48 and value type sigs in interfaces
52 class info (CE) {ClassStr -> (ClassId, [ClassOpStr])}
53 inst info (GIE) {(ClassId,TyConId) -> (Context, GlobalId)}
54 (info from both class and instance decls)
56 type/data info (TCE) {TyConStr -> (TyConId, [ConstrStr])}
59 value info (GVE) {ValStr -> GlobalId}
60 (info from value sigs, and constructors from data decls)
62 Filter and rename the environments gotten from each import to make a grand
67 Check E2 for class cycles, and type synonym cycles.
71 Process the value decls in the impl, giving {ValStr -> GlobalId}, and some
76 Process the bodies of instance decls, to generate code for methods.
85 1. Who generates the interface?
87 2. Where is dependency analysis done?