[project @ 1999-05-18 15:03:33 by simonpj]
[ghc-hetmet.git] / ghc / compiler / DEPEND-NOTES
1 add types/InstEnv, InstEnv.hi-boot
2 add coreSyn/CoreRules.*
3 add coreSyn/CoreTidy.lhs
4 add coreSyn/CoreFVs.lhs
5 remove coreSyn/FreeVars.lhs
6 add coreSyn/Subst.*
7 remove simplCore/MagicUFs.*
8
9 remove specialise/SpecEnv.*
10
11
12
13 ToDo
14 ~~~~
15 * Test effect of eta-expanding past (case x of ..)
16
17 * Bottom strictness isn't right.  Should be (eg) SSX, not just X.
18
19 * Enumeration types in worker/wrapper for strictness analysis
20
21 * Use (!) types in data cons to unbox.
22
23 * Check constant folding
24
25 * .hi file isn't updated if the only change is to the exports.
26   For example, UgenAll.lhs re-exports all of U_binding.hs; when a data type
27   decl in the latter changes, the .hi file for the former isn't updated.
28   I think this happens when a module exports another mdodule thus:
29
30         module UgenAll( module U_binding, ... ) where
31
32 * This should be reported as an error:
33         data T k = MkT (k Int#)
34
35 * Bogus report of overlapped pattern for
36         f (R {field = [c]}) = 1
37         f (R {})              = 2
38   This shows up for TyCon.maybeTyConSingleCon
39
40 *  > module Main( main ) where
41
42    > f :: String -> Int
43    > f "=<" = 0
44    > f "="  = 0
45    
46    > g :: [Char] -> Int
47    > g ['=','<'] = 0
48    > g ['=']     = 0
49    
50    > main = return ()
51    
52    For ``f'' the following is reported.
53    
54    tmp.lhs:4: 
55     Pattern match(es) are overlapped in the definition of function `f'
56             "=" = ...
57
58    There are no complaints for definition for ``g''.
59
60 * Without -O I don't think we need change the module version
61   if the usages change; I forget why it changes even with -O
62
63 * Record selectors for existential type; no good!  What to do?
64   Record update doesn't make sense either.
65
66   Need to be careful when figuring out strictness, and when generating
67   worker-wrapper split.
68
69   Also when deriving.
70
71 * Consructor re-use via CSE
72
73                 Notes on module dependencies
74                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
76 The Name/Var/Type group is a bit complicated. Here's the deal
77 Things in brackets are what the module *uses*.
78 A 'loop' indicates a use from a module compiled later
79
80         Name, PrimRep, FieldLabel (loop Type.Type)
81 then
82         Var (loop Const.Con, loop IdInfo.IdInfo, 
83              loop Type.GenType, loop Type.Kind)
84 then
85         VarEnv, VarSet, ThinAir
86 then
87         Class (loop TyCon.TyCon, loop Type.Type, loop InstEnv.InstEnv)
88 then
89         TyCon (loop Type.Type, loop Type.Kind, loop DataCon.DataCon)
90 then
91         Type (loop DataCon.DataCon, loop Subst.substTy)
92 then
93         DataCon, TysPrim, Unify, PprType
94 then
95         InstEnv (Unify)
96 then
97         IdInfo (loop CoreRules.CoreRules) 
98         TysWiredIn (DataCon.mkDataCon, loop MkId.mkDataConId)
99 then
100         PrimOp (PprType, TysWiredIn, IdInfo.StrictnessInfo)
101 then
102         Const (PrimOp.PrimOp, TysWiredIn.stringTy)
103 then
104         Id (Const.Con(..)), CoreSyn
105 then
106         CoreUtils (loop PprCore.pprCoreExpr), CoreFVs
107 then    
108         OccurAnal (ThinAir.noRepStrs -- an awkward dependency)
109 then
110         CoreUnfold (loop OccurAnal.globalOccurAnalyse)
111 then
112         Rules (Unfolding), Subst (Unfolding, CoreFVs), CoreTidy (noUnfolding)
113 then
114         MkId (CoreUnfold.mkUnfolding, Subst)
115
116