cvs commit: fptools/ghc/compiler NOTES
fptools/ghc/compiler/basicTypes
Id.lhs IdInfo.lhs MkId.lhs Name.lhs OccName.lhs
fptools/ghc/compiler/codeGen CodeGen.lhs fptools/ghc/compiler/coreSyn
CoreFVs.lhs CoreSubst.lhs CoreSyn.lhs CoreTidy.lhs PprCore.lhs ...
Simon Peyton Jones
simonpj at haskell.org
Thu Apr 28 06:09:52 EDT 2005
simonpj 2005/04/28 03:09:51 PDT
Modified files:
ghc/compiler NOTES
ghc/compiler/basicTypes Id.lhs IdInfo.lhs MkId.lhs Name.lhs
OccName.lhs
ghc/compiler/codeGen CodeGen.lhs
ghc/compiler/coreSyn CoreFVs.lhs CoreSubst.lhs CoreSyn.lhs
CoreTidy.lhs PprCore.lhs
ghc/compiler/deSugar Desugar.lhs
ghc/compiler/ghci InteractiveUI.hs
ghc/compiler/iface BinIface.hs BuildTyCl.lhs IfaceEnv.lhs
IfaceSyn.lhs IfaceType.lhs LoadIface.lhs
MkIface.lhs TcIface.hi-boot-6 TcIface.lhs
ghc/compiler/main DriverPipeline.hs GHC.hs HscMain.lhs
HscTypes.lhs TidyPgm.lhs
ghc/compiler/prelude PrelRules.lhs TysWiredIn.lhs
ghc/compiler/rename RnEnv.lhs RnExpr.lhs RnNames.lhs
ghc/compiler/simplCore OccurAnal.lhs SetLevels.lhs
SimplCore.lhs SimplEnv.lhs
ghc/compiler/specialise Rules.lhs SpecConstr.lhs
Specialise.lhs
ghc/compiler/typecheck Inst.lhs TcClassDcl.lhs TcDeriv.lhs
TcEnv.lhs TcExpr.lhs TcHsSyn.lhs
TcHsType.lhs TcInstDcls.lhs
TcRnDriver.lhs TcRnMonad.lhs
TcRnTypes.lhs TcSimplify.lhs
TcSplice.lhs TcTyClsDecls.lhs
TcType.lhs TcUnify.lhs
ghc/compiler/types FunDeps.lhs InstEnv.lhs TyCon.lhs
Log:
This big commit does several things at once (aeroplane hacking)
which change the format of interface files.
So you'll need to recompile your libraries!
1. The "stupid theta" of a newtype declaration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Retain the "stupid theta" in a newtype declaration.
For some reason this was being discarded, and putting it
back in meant changing TyCon and IfaceSyn slightly.
2. Overlap flags travel with the instance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arrange that the ability to support overlap and incoherence
is a property of the *instance declaration* rather than the
module that imports the instance decl. This allows a library
writer to define overlapping instance decls without the
library client having to know.
The implementation is that in an Instance we store the
overlap flag, and preseve that across interface files
3. Nuke the "instnce pool" and "rule pool"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A major tidy-up and simplification of the way that instances
and rules are sucked in from interface files. Up till now
an instance decl has been held in a "pool" until its "gates"
(a set of Names) are in play, when the instance is typechecked
and added to the InstEnv in the ExternalPackageState.
This is complicated and error-prone; it's easy to suck in
too few (and miss an instance) or too many (and thereby be
forced to suck in its type constructors, etc).
Now, as we load an instance from an interface files, we
put it straight in the InstEnv... but the Instance we put in
the InstEnv has some Names (the "rough-match" names) that
can be used on lookup to say "this Instance can't match".
The detailed dfun is only read lazily, and the rough-match
thing meansn it is'nt poked on until it has a chance of
being needed.
This simply continues the successful idea for Ids, whereby
they are loaded straightaway into the TypeEnv, but their
TyThing is a lazy thunk, not poked on until the thing is looked
up.
Just the same idea applies to Rules.
On the way, I made CoreRule and Instance into full-blown records
with lots of info, with the same kind of key status as TyCon or
DataCon or Class. And got rid of IdCoreRule altogether.
It's all much more solid and uniform, but it meant touching
a *lot* of modules.
4. Allow instance decls in hs-boot files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Allowing instance decls in hs-boot files is jolly useful, becuase
in a big mutually-recursive bunch of data types, you want to give
the instances with the data type declarations. To achieve this
* The hs-boot file makes a provisional name for the dict-fun, something
like $fx9.
* When checking the "mother module", we check that the instance
declarations line up (by type) and generate bindings for the
boot dfuns, such as
$fx9 = $f2
where $f2 is the dfun generated by the mother module
* In doing this I decided that it's cleaner to have DFunIds get their
final External Name at birth. To do that they need a stable OccName,
so I have an integer-valued dfun-name-supply in the TcM monad.
That keeps it simple.
This feature is hardly tested yet.
5. Tidy up tidying, and Iface file generation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main/TidyPgm now has two entry points:
simpleTidyPgm is for hi-boot files, when typechecking only
(not yet implemented), and potentially when compiling without -O.
It ignores the bindings, and generates a nice small TypeEnv.
optTidyPgm is the normal case: compiling with -O. It generates a
TypeEnv rich in IdInfo
MkIface.mkIface now only generates a ModIface. A separate
procedure, MkIface.writeIfaceFile, writes the file out to disk.
Revision Changes Path
1.14 +2 -0 fptools/ghc/compiler/NOTES
1.129 +5 -5 fptools/ghc/compiler/basicTypes/Id.lhs
1.117 +33 -4 fptools/ghc/compiler/basicTypes/IdInfo.lhs
1.123 +6 -11 fptools/ghc/compiler/basicTypes/MkId.lhs
1.118 +7 -2 fptools/ghc/compiler/basicTypes/Name.lhs
1.64 +17 -3 fptools/ghc/compiler/basicTypes/OccName.lhs
1.69 +0 -2 fptools/ghc/compiler/codeGen/CodeGen.lhs
1.24 +56 -43 fptools/ghc/compiler/coreSyn/CoreFVs.lhs
1.2 +19 -19 fptools/ghc/compiler/coreSyn/CoreSubst.lhs
1.58 +53 -47 fptools/ghc/compiler/coreSyn/CoreSyn.lhs
1.83 +26 -20 fptools/ghc/compiler/coreSyn/CoreTidy.lhs
1.88 +16 -14 fptools/ghc/compiler/coreSyn/PprCore.lhs
1.86 +49 -47 fptools/ghc/compiler/deSugar/Desugar.lhs
1.201 +5 -6 fptools/ghc/compiler/ghci/InteractiveUI.hs
1.15 +50 -24 fptools/ghc/compiler/iface/BinIface.hs
1.6 +7 -6 fptools/ghc/compiler/iface/BuildTyCl.lhs
1.16 +1 -1 fptools/ghc/compiler/iface/IfaceEnv.lhs
1.19 +111 -110 fptools/ghc/compiler/iface/IfaceSyn.lhs
1.17 +4 -4 fptools/ghc/compiler/iface/IfaceType.lhs
1.32 +28 -177 fptools/ghc/compiler/iface/LoadIface.lhs
1.30 +63 -122 fptools/ghc/compiler/iface/MkIface.lhs
1.3 +3 -0 fptools/ghc/compiler/iface/TcIface.hi-boot-6
1.38 +108 -224 fptools/ghc/compiler/iface/TcIface.lhs
1.201 +20 -15 fptools/ghc/compiler/main/DriverPipeline.hs
1.22 +2 -1 fptools/ghc/compiler/main/GHC.hs
1.217 +42 -31 fptools/ghc/compiler/main/HscMain.lhs
1.133 +20 -72 fptools/ghc/compiler/main/HscTypes.lhs
1.22 +279 -186 fptools/ghc/compiler/main/TidyPgm.lhs
1.45 +17 -13 fptools/ghc/compiler/prelude/PrelRules.lhs
1.96 +4 -3 fptools/ghc/compiler/prelude/TysWiredIn.lhs
1.193 +2 -2 fptools/ghc/compiler/rename/RnEnv.lhs
1.137 +2 -2 fptools/ghc/compiler/rename/RnExpr.lhs
1.190 +3 -0 fptools/ghc/compiler/rename/RnNames.lhs
1.76 +4 -12 fptools/ghc/compiler/simplCore/OccurAnal.lhs
1.66 +2 -2 fptools/ghc/compiler/simplCore/SetLevels.lhs
1.134 +63 -92 fptools/ghc/compiler/simplCore/SimplCore.lhs
1.44 +5 -5 fptools/ghc/compiler/simplCore/SimplEnv.lhs
1.49 +207 -149 fptools/ghc/compiler/specialise/Rules.lhs
1.25 +7 -7 fptools/ghc/compiler/specialise/SpecConstr.lhs
1.95 +6 -6 fptools/ghc/compiler/specialise/Specialise.lhs
1.153 +62 -53 fptools/ghc/compiler/typecheck/Inst.lhs
1.149 +6 -5 fptools/ghc/compiler/typecheck/TcClassDcl.lhs
1.142 +61 -47 fptools/ghc/compiler/typecheck/TcDeriv.lhs
1.144 +26 -20 fptools/ghc/compiler/typecheck/TcEnv.lhs
1.184 +1 -1 fptools/ghc/compiler/typecheck/TcExpr.lhs
1.106 +0 -2 fptools/ghc/compiler/typecheck/TcHsSyn.lhs
1.26 +12 -6 fptools/ghc/compiler/typecheck/TcHsType.lhs
1.175 +17 -11 fptools/ghc/compiler/typecheck/TcInstDcls.lhs
1.108 +52 -44 fptools/ghc/compiler/typecheck/TcRnDriver.lhs
1.51 +9 -0 fptools/ghc/compiler/typecheck/TcRnMonad.lhs
1.58 +13 -2 fptools/ghc/compiler/typecheck/TcRnTypes.lhs
1.155 +8 -7 fptools/ghc/compiler/typecheck/TcSimplify.lhs
1.55 +6 -5 fptools/ghc/compiler/typecheck/TcSplice.lhs
1.124 +6 -16 fptools/ghc/compiler/typecheck/TcTyClsDecls.lhs
1.124 +5 -14 fptools/ghc/compiler/typecheck/TcType.lhs
1.65 +8 -5 fptools/ghc/compiler/typecheck/TcUnify.lhs
1.28 +106 -19 fptools/ghc/compiler/types/FunDeps.lhs
1.42 +333 -208 fptools/ghc/compiler/types/InstEnv.lhs
1.80 +45 -39 fptools/ghc/compiler/types/TyCon.lhs
More information about the Cvs-ghc
mailing list