X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2FNOTES.import;fp=ghc%2Fdocs%2FNOTES.import;h=0000000000000000000000000000000000000000;hb=5eb1c77c795f92ed0f4c8023847e9d4be1a4fd0d;hp=30e65c4221a6fb5556e94f0d6c0fdec74cc179b6;hpb=f7ecf7234c224489be8a5e63fced903b655d92ee;p=ghc-hetmet.git diff --git a/ghc/docs/NOTES.import b/ghc/docs/NOTES.import deleted file mode 100644 index 30e65c4..0000000 --- a/ghc/docs/NOTES.import +++ /dev/null @@ -1,90 +0,0 @@ - Notes on imports - ~~~~~~~~~~~~~~~~ - SLPJ 15 March 91 - - -Distinguish three kinds of things in interfaces: - - - type, data, class, instance, value decls at top level - - - the same but imported. Syntax - import B renaming C to D where - data C = ... - - - imports, which serve just to attach original names - import B(X,Y) - - -The third group are syntactically stuck at the beginning; the second two -can be intermingled. - -Pass 1 -~~~~~~ -Process each imported interface, and the implementation being compiled, -scanning *headers of* - - type, data and class decls (incl imported ones in interfaces) - -giving the following environments for each - - type/data info {(ModStr,TyConStr) -> arity} - class info {(ModStr,ClassStr)} - -These are filtered (*but not renamed*) by the imports specified in the -impl (ignore dotdot parts and parts in parens), to give a grand -environment E1 of the same shape. It gives the original names of in-scope -types and classes. - -Pass 2 -~~~~~~ -Process each imported interface and the implementation being compiled: - - - scan its imports and use them to filter and rename E1, to give - - {TyConStr -> arity} - {ClassStr} - - - scan type, data, class decls, headers of instance decls - and value type sigs in interfaces - -giving for each: - - class info (CE) {ClassStr -> (ClassId, [ClassOpStr])} - inst info (GIE) {(ClassId,TyConId) -> (Context, GlobalId)} - (info from both class and instance decls) - - type/data info (TCE) {TyConStr -> (TyConId, [ConstrStr])} - - - value info (GVE) {ValStr -> GlobalId} - (info from value sigs, and constructors from data decls) - -Filter and rename the environments gotten from each import to make a grand -environment E2. - -Pass 3 -~~~~~~ -Check E2 for class cycles, and type synonym cycles. - -Pass 4 -~~~~~~ -Process the value decls in the impl, giving {ValStr -> GlobalId}, and some -code. - -Pass 5 -~~~~~~ -Process the bodies of instance decls, to generate code for methods. - - - - - - - UNRESOLVED - ~~~~~~~~~~ -1. Who generates the interface? - -2. Where is dependency analysis done? - - -