cvs commit: fptools/ghc/compiler Makefile count_lines
fptools/ghc/compiler/absCSyn AbsCSyn.lhs CLabel.lhs fptools/ghc/compiler/b
asicTypes BasicTypes.lhs IdInfo.lhs Literal.lhs MkId.lhs Module.lhs
Name.lhs NameEnv.lhs OccName.lhs ...
Simon Peyton Jones
simonpj@glass.cse.ogi.edu
Fri, 13 Sep 2002 08:02:50 -0700
simonpj 2002/09/13 08:02:50 PDT
Modified files:
ghc/compiler Makefile count_lines
ghc/compiler/absCSyn AbsCSyn.lhs CLabel.lhs
ghc/compiler/basicTypes BasicTypes.lhs IdInfo.lhs Literal.lhs
MkId.lhs Module.lhs Name.lhs
NameEnv.lhs OccName.lhs RdrName.lhs
SrcLoc.lhs Var.lhs
ghc/compiler/codeGen CgCase.lhs CgClosure.lhs CgExpr.lhs
CgHeapery.lhs CgLetNoEscape.lhs
CgMonad.lhs CgRetConv.lhs CgStackery.lhs
ClosureInfo.lhs CodeGen.lhs
ghc/compiler/compMan CompManager.lhs
ghc/compiler/coreSyn CoreFVs.lhs CoreLint.lhs CorePrep.lhs
CoreSyn.lhs MkExternalCore.lhs
PprCore.lhs
ghc/compiler/deSugar Check.lhs Desugar.lhs DsBinds.lhs
DsExpr.lhs DsForeign.lhs DsListComp.lhs
DsMonad.lhs DsUtils.lhs Match.lhs
MatchCon.lhs MatchLit.lhs
ghc/compiler/ghci ByteCodeFFI.lhs ByteCodeGen.lhs
ByteCodeInstr.lhs ByteCodeItbls.lhs
ByteCodeLink.lhs InteractiveUI.hs
Linker.lhs
ghc/compiler/hsSyn HsBinds.lhs HsCore.lhs HsDecls.lhs
HsExpr.hi-boot HsExpr.hi-boot-5
HsExpr.hi-boot-6 HsExpr.lhs HsImpExp.lhs
HsPat.lhs HsSyn.lhs HsTypes.lhs
ghc/compiler/main BinIface.hs CodeOutput.lhs Constants.lhs
DriverFlags.hs DriverMkDepend.hs
DriverPhases.hs DriverPipeline.hs
DriverState.hs DriverUtil.hs ErrUtils.lhs
Finder.lhs GetImports.hs HscMain.lhs
HscStats.lhs HscTypes.lhs Interpreter.hs
Main.hs MkIface.lhs Packages.lhs
SysTools.lhs TidyPgm.lhs
ghc/compiler/nativeGen AsmCodeGen.lhs
ghc/compiler/ndpFlatten FlattenInfo.hs FlattenMonad.hs
Flattening.hs
ghc/compiler/parser Lex.lhs ParseUtil.lhs Parser.y
ParserCore.y RdrHsSyn.lhs
ghc/compiler/prelude PrelInfo.lhs PrelNames.lhs PrelRules.lhs
PrimOp.lhs TysWiredIn.lhs
ghc/compiler/rename RnBinds.lhs RnEnv.lhs RnExpr.lhs
RnHiFiles.hi-boot-5 RnHiFiles.hi-boot-6
RnHiFiles.lhs RnHsSyn.lhs RnIfaces.lhs
RnNames.lhs RnSource.lhs RnTypes.lhs
ghc/compiler/simplCore FloatOut.lhs SetLevels.lhs
SimplCore.lhs
ghc/compiler/specialise SpecConstr.lhs Specialise.lhs
ghc/compiler/stgSyn CoreToStg.lhs StgLint.lhs
ghc/compiler/stranal DmdAnal.lhs
ghc/compiler/typecheck Inst.lhs TcBinds.lhs TcClassDcl.lhs
TcDefaults.lhs TcDeriv.lhs TcEnv.lhs
TcExpr.hi-boot TcExpr.hi-boot-5
TcExpr.hi-boot-6 TcExpr.lhs
TcForeign.lhs TcGenDeriv.lhs
TcHsSyn.lhs TcIfaceSig.lhs
TcInstDcls.lhs TcMType.lhs
TcMatches.hi-boot TcMatches.hi-boot-5
TcMatches.hi-boot-6 TcMatches.lhs
TcMonoType.lhs TcPat.lhs TcRules.lhs
TcSimplify.lhs TcTyClsDecls.lhs
TcTyDecls.lhs TcType.lhs
TcUnify.hi-boot TcUnify.hi-boot-5
TcUnify.hi-boot-6 TcUnify.lhs
ghc/compiler/types FunDeps.lhs Generics.lhs InstEnv.lhs
PprType.lhs Type.lhs
ghc/compiler/utils Binary.hs Outputable.lhs Panic.lhs
Pretty.lhs StringBuffer.lhs
ghc/docs/users_guide glasgow_exts.sgml
ghc/rts Linker.c
Added files:
ghc/compiler/deSugar DsMeta.hs
ghc/compiler/ghci ByteCodeAsm.lhs ObjLink.lhs
ghc/compiler/hsSyn Convert.lhs
ghc/compiler/rename RnSource.hi-boot-5 RnSource.hi-boot-6
ghc/compiler/typecheck TcRnDriver.lhs TcRnMonad.lhs
TcRnTypes.lhs TcSplice.hi-boot-6
TcSplice.lhs
Removed files:
ghc/compiler/basicTypes PprEnv.lhs
ghc/compiler/compMan CmLink.lhs CmTypes.lhs
ghc/compiler/rename Rename.lhs RnBinds.hi-boot
RnBinds.hi-boot-5 RnBinds.hi-boot-6
RnMonad.lhs
ghc/compiler/typecheck TcEnv.hi-boot TcEnv.hi-boot-5
TcEnv.hi-boot-6 TcModule.lhs
TcMonad.lhs
Log:
--------------------------------------
Make Template Haskell into the HEAD
--------------------------------------
This massive commit transfers to the HEAD all the stuff that
Simon and Tim have been doing on Template Haskell. The
meta-haskell-branch is no more!
WARNING: make sure that you
* Update your links if you are using link trees.
Some modules have been added, some have gone away.
* Do 'make clean' in all library trees.
The interface file format has changed, and you can
get strange panics (sadly) if GHC tries to read old interface files:
e.g. ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
Binary.get(TyClDecl): ForeignType
* You need to recompile the rts too; Linker.c has changed
However the libraries are almost unaltered; just a tiny change in
Base, and to the exports in Prelude.
NOTE: so far as TH itself is concerned, expression splices work
fine, but declaration splices are not complete.
---------------
The main change
---------------
The main structural change: renaming and typechecking have to be
interleaved, because we can't rename stuff after a declaration splice
until after we've typechecked the stuff before (and the splice
itself).
* Combine the renamer and typecheker monads into one
(TcRnMonad, TcRnTypes)
These two replace TcMonad and RnMonad
* Give them a single 'driver' (TcRnDriver). This driver
replaces TcModule.lhs and Rename.lhs
* The haskell-src library package has a module
Language/Haskell/THSyntax
which defines the Haskell data type seen by the TH programmer.
* New modules:
hsSyn/Convert.hs converts THSyntax -> HsSyn
deSugar/DsMeta.hs converts HsSyn -> THSyntax
* New module typecheck/TcSplice type-checks Template Haskell splices.
-------------
Linking stuff
-------------
* ByteCodeLink has been split into
ByteCodeLink (which links)
ByteCodeAsm (which assembles)
* New module ghci/ObjLink is the object-code linker.
* compMan/CmLink is removed entirely (was out of place)
Ditto CmTypes (which was tiny)
* Linker.c initialises the linker when it is first used (no need to call
initLinker any more). Template Haskell makes it harder to know when
and whether to initialise the linker.
-------------------------------------
Gathering the LIE in the type checker
-------------------------------------
* Instead of explicitly gathering constraints in the LIE
tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
we now dump the constraints into a mutable varabiable carried
by the monad, so we get
tcExpr :: RenamedExpr -> TcM TypecheckedExpr
Much less clutter in the code, and more efficient too.
(Originally suggested by Mark Shields.)
-----------------
Remove "SysNames"
-----------------
Because the renamer and the type checker were entirely separate,
we had to carry some rather tiresome implicit binders (or "SysNames")
along inside some of the HsDecl data structures. They were both
tiresome and fragile.
Now that the typechecker and renamer are more intimately coupled,
we can eliminate SysNames (well, mostly... default methods still
carry something similar).
-------------
Clean up HsPat
-------------
One big clean up is this: instead of having two HsPat types (InPat and
OutPat), they are now combined into one. This is more consistent with
the way that HsExpr etc is handled; there are some 'Out' constructors
for the type checker output.
So:
HsPat.InPat --> HsPat.Pat
HsPat.OutPat --> HsPat.Pat
No 'pat' type parameter in HsExpr, HsBinds, etc
Constructor patterns are nicer now: they use
HsPat.HsConDetails
for the three cases of constructor patterns:
prefix, infix, and record-bindings
The *same* data type HsConDetails is used in the type
declaration of the data type (HsDecls.TyData)
Lots of associated clean-up operations here and there. Less code.
Everything is wonderful.
Revision Changes Path
1.222 +12 -7 fptools/ghc/compiler/Makefile
1.6 +1 -0 fptools/ghc/compiler/count_lines
1.50 +1 -1 fptools/ghc/compiler/absCSyn/AbsCSyn.lhs
1.55 +1 -2 fptools/ghc/compiler/absCSyn/CLabel.lhs
1.31 +46 -7 fptools/ghc/compiler/basicTypes/BasicTypes.lhs
1.103 +6 -3 fptools/ghc/compiler/basicTypes/IdInfo.lhs
1.37 +2 -2 fptools/ghc/compiler/basicTypes/Literal.lhs
1.102 +22 -31 fptools/ghc/compiler/basicTypes/MkId.lhs
1.53 +56 -39 fptools/ghc/compiler/basicTypes/Module.lhs
1.100 +36 -52 fptools/ghc/compiler/basicTypes/Name.lhs
1.3 +3 -2 fptools/ghc/compiler/basicTypes/NameEnv.lhs
1.49 +7 -7 fptools/ghc/compiler/basicTypes/OccName.lhs
1.21 +132 -88 fptools/ghc/compiler/basicTypes/RdrName.lhs
1.23 +18 -11 fptools/ghc/compiler/basicTypes/SrcLoc.lhs
1.31 +12 -16 fptools/ghc/compiler/basicTypes/Var.lhs
1.60 +1 -1 fptools/ghc/compiler/codeGen/CgCase.lhs
1.58 +1 -1 fptools/ghc/compiler/codeGen/CgClosure.lhs
1.51 +1 -1 fptools/ghc/compiler/codeGen/CgExpr.lhs
1.34 +1 -1 fptools/ghc/compiler/codeGen/CgHeapery.lhs
1.18 +1 -1 fptools/ghc/compiler/codeGen/CgLetNoEscape.lhs
1.35 +1 -1 fptools/ghc/compiler/codeGen/CgMonad.lhs
1.33 +1 -1 fptools/ghc/compiler/codeGen/CgRetConv.lhs
1.22 +1 -1 fptools/ghc/compiler/codeGen/CgStackery.lhs
1.53 +1 -1 fptools/ghc/compiler/codeGen/ClosureInfo.lhs
1.51 +22 -23 fptools/ghc/compiler/codeGen/CodeGen.lhs
1.120 +344 -319 fptools/ghc/compiler/compMan/CompManager.lhs
1.19 +4 -4 fptools/ghc/compiler/coreSyn/CoreFVs.lhs
1.68 +10 -10 fptools/ghc/compiler/coreSyn/CoreLint.lhs
1.27 +7 -7 fptools/ghc/compiler/coreSyn/CorePrep.lhs
1.49 +12 -6 fptools/ghc/compiler/coreSyn/CoreSyn.lhs
1.11 +10 -11 fptools/ghc/compiler/coreSyn/MkExternalCore.lhs
1.74 +97 -136 fptools/ghc/compiler/coreSyn/PprCore.lhs
1.33 +162 -161 fptools/ghc/compiler/deSugar/Check.lhs
1.54 +78 -70 fptools/ghc/compiler/deSugar/Desugar.lhs
1.49 +3 -3 fptools/ghc/compiler/deSugar/DsBinds.lhs
1.87 +41 -76 fptools/ghc/compiler/deSugar/DsExpr.lhs
1.71 +37 -50 fptools/ghc/compiler/deSugar/DsForeign.lhs
1.37 +19 -19 fptools/ghc/compiler/deSugar/DsListComp.lhs
1.45 +122 -74 fptools/ghc/compiler/deSugar/DsMonad.lhs
1.63 +53 -32 fptools/ghc/compiler/deSugar/DsUtils.lhs
1.61 +62 -57 fptools/ghc/compiler/deSugar/Match.lhs
1.16 +5 -5 fptools/ghc/compiler/deSugar/MatchCon.lhs
1.31 +78 -14 fptools/ghc/compiler/deSugar/MatchLit.lhs
1.14 +6 -6 fptools/ghc/compiler/ghci/ByteCodeFFI.lhs
1.82 +26 -36 fptools/ghc/compiler/ghci/ByteCodeGen.lhs
1.10 +1 -1 fptools/ghc/compiler/ghci/ByteCodeInstr.lhs
1.14 +17 -11 fptools/ghc/compiler/ghci/ByteCodeItbls.lhs
1.43 +51 -543 fptools/ghc/compiler/ghci/ByteCodeLink.lhs
1.134 +88 -298 fptools/ghc/compiler/ghci/InteractiveUI.hs
1.15 +753 -56 fptools/ghc/compiler/ghci/Linker.lhs
1.63 +31 -39 fptools/ghc/compiler/hsSyn/HsBinds.lhs
1.46 +19 -19 fptools/ghc/compiler/hsSyn/HsCore.lhs
1.92 +124 -173 fptools/ghc/compiler/hsSyn/HsDecls.lhs
1.11 +3 -3 fptools/ghc/compiler/hsSyn/HsExpr.hi-boot
1.8 +6 -6 fptools/ghc/compiler/hsSyn/HsExpr.hi-boot-5
1.3 +9 -9 fptools/ghc/compiler/hsSyn/HsExpr.hi-boot-6
1.69 +170 -143 fptools/ghc/compiler/hsSyn/HsExpr.lhs
1.21 +27 -14 fptools/ghc/compiler/hsSyn/HsImpExp.lhs
1.40 +224 -259 fptools/ghc/compiler/hsSyn/HsPat.lhs
1.36 +15 -35 fptools/ghc/compiler/hsSyn/HsSyn.lhs
1.69 +45 -29 fptools/ghc/compiler/hsSyn/HsTypes.lhs
1.10 +81 -57 fptools/ghc/compiler/main/BinIface.hs
1.42 +37 -20 fptools/ghc/compiler/main/CodeOutput.lhs
1.31 +2 -1 fptools/ghc/compiler/main/Constants.lhs
1.102 +6 -1 fptools/ghc/compiler/main/DriverFlags.hs
1.22 +3 -3 fptools/ghc/compiler/main/DriverMkDepend.hs
1.22 +1 -1 fptools/ghc/compiler/main/DriverPhases.hs
1.137 +287 -207 fptools/ghc/compiler/main/DriverPipeline.hs
1.82 +60 -37 fptools/ghc/compiler/main/DriverState.hs
1.34 +1 -1 fptools/ghc/compiler/main/DriverUtil.hs
1.39 +60 -44 fptools/ghc/compiler/main/ErrUtils.lhs
1.57 +17 -16 fptools/ghc/compiler/main/Finder.lhs
1.10 +1 -1 fptools/ghc/compiler/main/GetImports.hs
1.167 +284 -447 fptools/ghc/compiler/main/HscMain.lhs
1.8 +5 -5 fptools/ghc/compiler/main/HscStats.lhs
1.96 +410 -212 fptools/ghc/compiler/main/HscTypes.lhs
1.12 +3 -9 fptools/ghc/compiler/main/Interpreter.hs
1.111 +12 -13 fptools/ghc/compiler/main/Main.hs
1.160 +304 -120 fptools/ghc/compiler/main/MkIface.lhs
1.8 +67 -7 fptools/ghc/compiler/main/Packages.lhs
1.78 +3 -2 fptools/ghc/compiler/main/SysTools.lhs
1.5 +21 -24 fptools/ghc/compiler/main/TidyPgm.lhs
1.57 +1 -1 fptools/ghc/compiler/nativeGen/AsmCodeGen.lhs
1.3 +4 -4 fptools/ghc/compiler/ndpFlatten/FlattenInfo.hs
1.4 +12 -12 fptools/ghc/compiler/ndpFlatten/FlattenMonad.hs
1.5 +23 -19 fptools/ghc/compiler/ndpFlatten/Flattening.hs
1.85 +110 -62 fptools/ghc/compiler/parser/Lex.lhs
1.58 +29 -36 fptools/ghc/compiler/parser/ParseUtil.lhs
1.102 +85 -55 fptools/ghc/compiler/parser/Parser.y
1.7 +11 -10 fptools/ghc/compiler/parser/ParserCore.y
1.44 +34 -52 fptools/ghc/compiler/parser/RdrHsSyn.lhs
1.82 +6 -42 fptools/ghc/compiler/prelude/PrelInfo.lhs
1.60 +589 -441 fptools/ghc/compiler/prelude/PrelNames.lhs
1.36 +1 -1 fptools/ghc/compiler/prelude/PrelRules.lhs
1.103 +35 -13 fptools/ghc/compiler/prelude/PrimOp.lhs
1.83 +8 -7 fptools/ghc/compiler/prelude/TysWiredIn.lhs
1.76 +88 -109 fptools/ghc/compiler/rename/RnBinds.lhs
1.153 +410 -574 fptools/ghc/compiler/rename/RnEnv.lhs
1.97 +411 -369 fptools/ghc/compiler/rename/RnExpr.lhs
1.3 +2 -1 fptools/ghc/compiler/rename/RnHiFiles.hi-boot-5
1.3 +2 -2 fptools/ghc/compiler/rename/RnHiFiles.hi-boot-6
1.68 +403 -262 fptools/ghc/compiler/rename/RnHiFiles.lhs
1.71 +29 -22 fptools/ghc/compiler/rename/RnHsSyn.lhs
1.154 +323 -495 fptools/ghc/compiler/rename/RnIfaces.lhs
1.132 +439 -243 fptools/ghc/compiler/rename/RnNames.lhs
1.145 +465 -288 fptools/ghc/compiler/rename/RnSource.lhs
1.9 +83 -85 fptools/ghc/compiler/rename/RnTypes.lhs
1.31 +10 -10 fptools/ghc/compiler/simplCore/FloatOut.lhs
1.58 +23 -21 fptools/ghc/compiler/simplCore/SetLevels.lhs
1.107 +45 -25 fptools/ghc/compiler/simplCore/SimplCore.lhs
1.19 +1 -1 fptools/ghc/compiler/specialise/SpecConstr.lhs
1.85 +1 -1 fptools/ghc/compiler/specialise/Specialise.lhs
1.96 +1 -1 fptools/ghc/compiler/stgSyn/CoreToStg.lhs
1.41 +9 -8 fptools/ghc/compiler/stgSyn/StgLint.lhs
1.44 +3 -3 fptools/ghc/compiler/stranal/DmdAnal.lhs
1.103 +173 -244 fptools/ghc/compiler/typecheck/Inst.lhs
1.108 +133 -139 fptools/ghc/compiler/typecheck/TcBinds.lhs
1.119 +95 -84 fptools/ghc/compiler/typecheck/TcClassDcl.lhs
1.27 +15 -19 fptools/ghc/compiler/typecheck/TcDefaults.lhs
1.99 +82 -83 fptools/ghc/compiler/typecheck/TcDeriv.lhs
1.110 +308 -236 fptools/ghc/compiler/typecheck/TcEnv.lhs
1.7 +2 -2 fptools/ghc/compiler/typecheck/TcExpr.hi-boot
1.8 +2 -2 fptools/ghc/compiler/typecheck/TcExpr.hi-boot-5
1.4 +2 -2 fptools/ghc/compiler/typecheck/TcExpr.hi-boot-6
1.127 +441 -387 fptools/ghc/compiler/typecheck/TcExpr.lhs
1.56 +59 -56 fptools/ghc/compiler/typecheck/TcForeign.lhs
1.86 +102 -77 fptools/ghc/compiler/typecheck/TcGenDeriv.lhs
1.78 +558 -544 fptools/ghc/compiler/typecheck/TcHsSyn.lhs
1.85 +103 -114 fptools/ghc/compiler/typecheck/TcIfaceSig.lhs
1.150 +123 -151 fptools/ghc/compiler/typecheck/TcInstDcls.lhs
1.38 +266 -243 fptools/ghc/compiler/typecheck/TcMType.lhs
1.6 +2 -2 fptools/ghc/compiler/typecheck/TcMatches.hi-boot
1.6 +2 -2 fptools/ghc/compiler/typecheck/TcMatches.hi-boot-5
1.3 +2 -2 fptools/ghc/compiler/typecheck/TcMatches.hi-boot-6
1.66 +153 -102 fptools/ghc/compiler/typecheck/TcMatches.lhs
1.104 +138 -138 fptools/ghc/compiler/typecheck/TcMonoType.lhs
1.86 +190 -207 fptools/ghc/compiler/typecheck/TcPat.lhs
1.38 +40 -51 fptools/ghc/compiler/typecheck/TcRules.lhs
1.106 +214 -197 fptools/ghc/compiler/typecheck/TcSimplify.lhs
1.91 +135 -129 fptools/ghc/compiler/typecheck/TcTyClsDecls.lhs
1.86 +57 -41 fptools/ghc/compiler/typecheck/TcTyDecls.lhs
1.82 +27 -22 fptools/ghc/compiler/typecheck/TcType.lhs
1.2 +1 -1 fptools/ghc/compiler/typecheck/TcUnify.hi-boot
1.3 +1 -1 fptools/ghc/compiler/typecheck/TcUnify.hi-boot-5
1.3 +1 -1 fptools/ghc/compiler/typecheck/TcUnify.hi-boot-6
1.39 +147 -149 fptools/ghc/compiler/typecheck/TcUnify.lhs
1.19 +2 -2 fptools/ghc/compiler/types/FunDeps.lhs
1.27 +7 -7 fptools/ghc/compiler/types/Generics.lhs
1.23 +13 -5 fptools/ghc/compiler/types/InstEnv.lhs
1.69 +3 -0 fptools/ghc/compiler/types/PprType.lhs
1.108 +0 -2 fptools/ghc/compiler/types/Type.lhs
1.14 +5 -4 fptools/ghc/compiler/utils/Binary.hs
1.53 +52 -8 fptools/ghc/compiler/utils/Outputable.lhs
1.11 +7 -1 fptools/ghc/compiler/utils/Panic.lhs
1.26 +2 -1 fptools/ghc/compiler/utils/Pretty.lhs
1.58 +10 -10 fptools/ghc/compiler/utils/StringBuffer.lhs
1.70 +24 -1 fptools/ghc/docs/users_guide/glasgow_exts.sgml
1.103 +53 -9 fptools/ghc/rts/Linker.c
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc