simonpj 2004/09/30 03:40:22 PDT
Modified files:
ghc/compiler HsVersions.h NOTES
ghc/compiler/basicTypes DataCon.hi-boot-6 DataCon.lhs Id.lhs
IdInfo.lhs Literal.lhs MkId.lhs
Name.lhs Var.lhs VarEnv.lhs VarSet.lhs
ghc/compiler/codeGen CgBindery.lhs CgCase.lhs CgClosure.lhs
CgCon.lhs CgExpr.lhs CgHeapery.lhs
CgLetNoEscape.lhs CgProf.hs
CgStackery.lhs CgTailCall.lhs
ClosureInfo.lhs CodeGen.lhs
ghc/compiler/coreSyn CoreFVs.lhs CoreLint.lhs CorePrep.lhs
CoreSyn.lhs CoreTidy.lhs CoreUnfold.lhs
CoreUtils.lhs ExternalCore.lhs
MkExternalCore.lhs PprCore.lhs
PprExternalCore.lhs Subst.lhs
ghc/compiler/deSugar Check.lhs Desugar.lhs DsArrows.lhs
DsBinds.lhs DsCCall.lhs DsExpr.lhs
DsGRHSs.lhs DsListComp.lhs DsMeta.hs
DsMonad.lhs DsUtils.lhs Match.hi-boot-6
Match.lhs MatchCon.lhs MatchLit.lhs
ghc/compiler/ghci ByteCodeGen.lhs InteractiveUI.hs
ghc/compiler/hsSyn Convert.lhs HsBinds.lhs HsDecls.lhs
HsExpr.hi-boot-6 HsExpr.lhs HsPat.lhs
HsTypes.lhs HsUtils.lhs
ghc/compiler/iface BinIface.hs BuildTyCl.lhs IfaceEnv.lhs
IfaceSyn.lhs IfaceType.lhs LoadIface.lhs
MkIface.lhs TcIface.lhs
ghc/compiler/main CodeOutput.lhs DriverMkDepend.hs
DriverPhases.hs DriverUtil.hs HscMain.lhs
HscStats.lhs HscTypes.lhs Main.hs
TidyPgm.lhs
ghc/compiler/ndpFlatten Flattening.hs NDPCoreUtils.hs
PArrAnal.hs
ghc/compiler/parser Parser.y.pp ParserCore.y RdrHsSyn.lhs
ghc/compiler/prelude PrelRules.lhs TysWiredIn.lhs
ghc/compiler/rename RnBinds.lhs RnEnv.lhs RnExpr.lhs
RnHsSyn.lhs RnNames.lhs RnSource.lhs
RnTypes.lhs
ghc/compiler/simplCore CSE.lhs FloatIn.lhs FloatOut.lhs
LiberateCase.lhs OccurAnal.lhs
SetLevels.lhs SimplCore.lhs
SimplMonad.lhs SimplUtils.lhs
Simplify.lhs
ghc/compiler/specialise Rules.lhs SpecConstr.lhs
Specialise.lhs
ghc/compiler/stgSyn CoreToStg.lhs
ghc/compiler/stranal DmdAnal.lhs WorkWrap.lhs WwLib.lhs
ghc/compiler/typecheck Inst.lhs TcArrows.lhs TcBinds.lhs
TcClassDcl.lhs TcDefaults.lhs
TcDeriv.lhs TcEnv.lhs TcExpr.hi-boot-6
TcExpr.lhs TcForeign.lhs TcGenDeriv.lhs
TcHsSyn.lhs TcHsType.lhs TcInstDcls.lhs
TcMType.lhs TcMatches.hi-boot-6
TcMatches.lhs TcPat.lhs TcRnDriver.lhs
TcRnMonad.lhs TcRnTypes.lhs TcRules.lhs
TcSimplify.lhs TcSplice.lhs
TcTyClsDecls.lhs TcTyDecls.lhs
TcType.hi-boot-6 TcType.lhs TcUnify.lhs
ghc/compiler/types FunDeps.lhs Generics.lhs InstEnv.lhs
Kind.lhs TyCon.lhs Type.lhs TypeRep.lhs
ghc/compiler/utils Outputable.lhs Panic.lhs UniqFM.lhs
Added files:
ghc/compiler/types Unify.lhs
Log:
------------------------------------
Add Generalised Algebraic Data Types
------------------------------------
This rather big commit adds support for GADTs. For example,
data Term a where
Lit :: Int -> Term Int
App :: Term (a->b) -> Term a -> Term b
If :: Term Bool -> Term a -> Term a
..etc..
eval :: Term a -> a
eval (Lit i) = i
eval (App a b) = eval a (eval b)
eval (If p q r) | eval p = eval q
| otherwise = eval r
Lots and lots of of related changes throughout the compiler to make
this fit nicely.
One important change, only loosely related to GADTs, is that skolem
constants in the typechecker are genuinely immutable and constant, so
we often get better error messages from the type checker. See
TcType.TcTyVarDetails.
There's a new module types/Unify.lhs, which has purely-functional
unification and matching for Type. This is used both in the typechecker
(for type refinement of GADTs) and in Core Lint (also for type refinement).
Revision Changes Path
1.34 +3 -10 fptools/ghc/compiler/HsVersions.h
1.13 +3 -0 fptools/ghc/compiler/NOTES
1.5 +1 -1 fptools/ghc/compiler/basicTypes/DataCon.hi-boot-6
1.48 +117 -112 fptools/ghc/compiler/basicTypes/DataCon.lhs
1.123 +5 -5 fptools/ghc/compiler/basicTypes/Id.lhs
1.114 +4 -3 fptools/ghc/compiler/basicTypes/IdInfo.lhs
1.47 +5 -1 fptools/ghc/compiler/basicTypes/Literal.lhs
1.115 +53 -62 fptools/ghc/compiler/basicTypes/MkId.lhs
1.114 +18 -15 fptools/ghc/compiler/basicTypes/Name.lhs
1.37 +7 -11 fptools/ghc/compiler/basicTypes/Var.lhs
1.15 +105 -73 fptools/ghc/compiler/basicTypes/VarEnv.lhs
1.15 +4 -1 fptools/ghc/compiler/basicTypes/VarSet.lhs
1.53 +5 -5 fptools/ghc/compiler/codeGen/CgBindery.lhs
1.71 +1 -1 fptools/ghc/compiler/codeGen/CgCase.lhs
1.64 +1 -1 fptools/ghc/compiler/codeGen/CgClosure.lhs
1.48 +2 -2 fptools/ghc/compiler/codeGen/CgCon.lhs
1.60 +1 -1 fptools/ghc/compiler/codeGen/CgExpr.lhs
1.41 +1 -1 fptools/ghc/compiler/codeGen/CgHeapery.lhs
1.26 +1 -1 fptools/ghc/compiler/codeGen/CgLetNoEscape.lhs
1.3 +2 -2 fptools/ghc/compiler/codeGen/CgProf.hs
1.27 +1 -1 fptools/ghc/compiler/codeGen/CgStackery.lhs
1.40 +1 -1 fptools/ghc/compiler/codeGen/CgTailCall.lhs
1.64 +2 -2 fptools/ghc/compiler/codeGen/ClosureInfo.lhs
1.61 +1 -1 fptools/ghc/compiler/codeGen/CodeGen.lhs
1.21 +12 -7 fptools/ghc/compiler/coreSyn/CoreFVs.lhs
1.78 +295 -228 fptools/ghc/compiler/coreSyn/CoreLint.lhs
1.35 +6 -3 fptools/ghc/compiler/coreSyn/CorePrep.lhs
1.53 +16 -12 fptools/ghc/compiler/coreSyn/CoreSyn.lhs
1.78 +4 -2 fptools/ghc/compiler/coreSyn/CoreTidy.lhs
1.94 +5 -4 fptools/ghc/compiler/coreSyn/CoreUnfold.lhs
1.126 +51 -38 fptools/ghc/compiler/coreSyn/CoreUtils.lhs
1.9 +2 -1 fptools/ghc/compiler/coreSyn/ExternalCore.lhs
1.27 +5 -4 fptools/ghc/compiler/coreSyn/MkExternalCore.lhs
1.83 +7 -5 fptools/ghc/compiler/coreSyn/PprCore.lhs
1.7 +4 -1 fptools/ghc/compiler/coreSyn/PprExternalCore.lhs
1.44 +165 -338 fptools/ghc/compiler/coreSyn/Subst.lhs
1.37 +108 -121 fptools/ghc/compiler/deSugar/Check.lhs
1.75 +5 -8 fptools/ghc/compiler/deSugar/Desugar.lhs
1.12 +19 -13 fptools/ghc/compiler/deSugar/DsArrows.lhs
1.54 +15 -13 fptools/ghc/compiler/deSugar/DsBinds.lhs
1.70 +18 -6 fptools/ghc/compiler/deSugar/DsCCall.lhs
1.109 +45 -50 fptools/ghc/compiler/deSugar/DsExpr.lhs
1.35 +31 -26 fptools/ghc/compiler/deSugar/DsGRHSs.lhs
1.48 +14 -9 fptools/ghc/compiler/deSugar/DsListComp.lhs
1.63 +14 -14 fptools/ghc/compiler/deSugar/DsMeta.hs
1.54 +1 -2 fptools/ghc/compiler/deSugar/DsMonad.lhs
1.77 +120 -107 fptools/ghc/compiler/deSugar/DsUtils.lhs
1.4 +6 -4 fptools/ghc/compiler/deSugar/Match.hi-boot-6
1.66 +178 -253 fptools/ghc/compiler/deSugar/Match.lhs
1.19 +51 -60 fptools/ghc/compiler/deSugar/MatchCon.lhs
1.36 +181 -133 fptools/ghc/compiler/deSugar/MatchLit.lhs
1.106 +8 -8 fptools/ghc/compiler/ghci/ByteCodeGen.lhs
1.176 +20 -8 fptools/ghc/compiler/ghci/InteractiveUI.hs
1.52 +11 -11 fptools/ghc/compiler/hsSyn/Convert.lhs
1.76 +19 -12 fptools/ghc/compiler/hsSyn/HsBinds.lhs
1.107 +17 -30 fptools/ghc/compiler/hsSyn/HsDecls.lhs
1.6 +4 -5 fptools/ghc/compiler/hsSyn/HsExpr.hi-boot-6
1.94 +29 -14 fptools/ghc/compiler/hsSyn/HsExpr.lhs
1.44 +53 -128 fptools/ghc/compiler/hsSyn/HsPat.lhs
1.81 +42 -27 fptools/ghc/compiler/hsSyn/HsTypes.lhs
1.5 +113 -25 fptools/ghc/compiler/hsSyn/HsUtils.lhs
1.7 +40 -20 fptools/ghc/compiler/iface/BinIface.hs
1.5 +90 -99 fptools/ghc/compiler/iface/BuildTyCl.lhs
1.9 +1 -5 fptools/ghc/compiler/iface/IfaceEnv.lhs
1.12 +128 -73 fptools/ghc/compiler/iface/IfaceSyn.lhs
1.8 +1 -1 fptools/ghc/compiler/iface/IfaceType.lhs
1.15 +16 -13 fptools/ghc/compiler/iface/LoadIface.lhs
1.16 +4 -8 fptools/ghc/compiler/iface/MkIface.lhs
1.24 +96 -88 fptools/ghc/compiler/iface/TcIface.lhs
1.51 +0 -1 fptools/ghc/compiler/main/CodeOutput.lhs
1.33 +1 -1 fptools/ghc/compiler/main/DriverMkDepend.hs
1.30 +1 -1 fptools/ghc/compiler/main/DriverPhases.hs
1.44 +1 -1 fptools/ghc/compiler/main/DriverUtil.hs
1.199 +2 -1 fptools/ghc/compiler/main/HscMain.lhs
1.14 +3 -3 fptools/ghc/compiler/main/HscStats.lhs
1.116 +2 -2 fptools/ghc/compiler/main/HscTypes.lhs
1.139 +1 -1 fptools/ghc/compiler/main/Main.hs
1.16 +2 -1 fptools/ghc/compiler/main/TidyPgm.lhs
1.10 +8 -4 fptools/ghc/compiler/ndpFlatten/Flattening.hs
1.4 +4 -3 fptools/ghc/compiler/ndpFlatten/NDPCoreUtils.hs
1.4 +2 -1 fptools/ghc/compiler/ndpFlatten/PArrAnal.hs
1.15 +42 -37 fptools/ghc/compiler/parser/Parser.y.pp
1.19 +7 -5 fptools/ghc/compiler/parser/ParserCore.y
1.75 +74 -46 fptools/ghc/compiler/parser/RdrHsSyn.lhs
1.39 +4 -2 fptools/ghc/compiler/prelude/PrelRules.lhs
1.94 +7 -9 fptools/ghc/compiler/prelude/TysWiredIn.lhs
1.92 +21 -22 fptools/ghc/compiler/rename/RnBinds.lhs
1.180 +7 -8 fptools/ghc/compiler/rename/RnEnv.lhs
1.130 +40 -28 fptools/ghc/compiler/rename/RnExpr.lhs
1.79 +7 -2 fptools/ghc/compiler/rename/RnHsSyn.lhs
1.173 +3 -4 fptools/ghc/compiler/rename/RnNames.lhs
1.167 +57 -29 fptools/ghc/compiler/rename/RnSource.lhs
1.28 +9 -5 fptools/ghc/compiler/rename/RnTypes.lhs
1.16 +2 -3 fptools/ghc/compiler/simplCore/CSE.lhs
1.35 +3 -2 fptools/ghc/compiler/simplCore/FloatIn.lhs
1.34 +3 -2 fptools/ghc/compiler/simplCore/FloatOut.lhs
1.26 +3 -2 fptools/ghc/compiler/simplCore/LiberateCase.lhs
1.72 +4 -2 fptools/ghc/compiler/simplCore/OccurAnal.lhs
1.61 +7 -5 fptools/ghc/compiler/simplCore/SetLevels.lhs
1.123 +1 -1 fptools/ghc/compiler/simplCore/SimplCore.lhs
1.58 +25 -26 fptools/ghc/compiler/simplCore/SimplMonad.lhs
1.93 +35 -29 fptools/ghc/compiler/simplCore/SimplUtils.lhs
1.150 +112 -67 fptools/ghc/compiler/simplCore/Simplify.lhs
1.41 +55 -33 fptools/ghc/compiler/specialise/Rules.lhs
1.21 +4 -2 fptools/ghc/compiler/specialise/SpecConstr.lhs
1.89 +9 -8 fptools/ghc/compiler/specialise/Specialise.lhs
1.112 +4 -3 fptools/ghc/compiler/stgSyn/CoreToStg.lhs
1.50 +8 -4 fptools/ghc/compiler/stranal/DmdAnal.lhs
1.61 +4 -2 fptools/ghc/compiler/stranal/WorkWrap.lhs
1.69 +14 -7 fptools/ghc/compiler/stranal/WwLib.lhs
1.140 +56 -72 fptools/ghc/compiler/typecheck/Inst.lhs
1.9 +49 -43 fptools/ghc/compiler/typecheck/TcArrows.lhs
1.126 +334 -349 fptools/ghc/compiler/typecheck/TcBinds.lhs
1.143 +60 -60 fptools/ghc/compiler/typecheck/TcClassDcl.lhs
1.33 +2 -2 fptools/ghc/compiler/typecheck/TcDefaults.lhs
1.135 +14 -17 fptools/ghc/compiler/typecheck/TcDeriv.lhs
1.131 +24 -29 fptools/ghc/compiler/typecheck/TcEnv.lhs
1.7 +4 -0 fptools/ghc/compiler/typecheck/TcExpr.hi-boot-6
1.171 +205 -180 fptools/ghc/compiler/typecheck/TcExpr.lhs
1.69 +5 -3 fptools/ghc/compiler/typecheck/TcForeign.lhs
1.113 +23 -25 fptools/ghc/compiler/typecheck/TcGenDeriv.lhs
1.101 +154 -167 fptools/ghc/compiler/typecheck/TcHsSyn.lhs
1.15 +166 -97 fptools/ghc/compiler/typecheck/TcHsType.lhs
1.168 +34 -32 fptools/ghc/compiler/typecheck/TcInstDcls.lhs
1.57 +230 -135 fptools/ghc/compiler/typecheck/TcMType.lhs
1.8 +2 -2 fptools/ghc/compiler/typecheck/TcMatches.hi-boot-6
1.83 +174 -239 fptools/ghc/compiler/typecheck/TcMatches.lhs
1.97 +472 -377 fptools/ghc/compiler/typecheck/TcPat.lhs
1.79 +28 -23 fptools/ghc/compiler/typecheck/TcRnDriver.lhs
1.38 +58 -25 fptools/ghc/compiler/typecheck/TcRnMonad.lhs
1.40 +55 -85 fptools/ghc/compiler/typecheck/TcRnTypes.lhs
1.49 +22 -19 fptools/ghc/compiler/typecheck/TcRules.lhs
1.139 +29 -20 fptools/ghc/compiler/typecheck/TcSimplify.lhs
1.40 +26 -18 fptools/ghc/compiler/typecheck/TcSplice.lhs
1.109 +108 -62 fptools/ghc/compiler/typecheck/TcTyClsDecls.lhs
1.97 +2 -2 fptools/ghc/compiler/typecheck/TcTyDecls.lhs
1.3 +1 -1 fptools/ghc/compiler/typecheck/TcType.hi-boot-6
1.108 +108 -345 fptools/ghc/compiler/typecheck/TcType.lhs
1.56 +457 -368 fptools/ghc/compiler/typecheck/TcUnify.lhs
1.25 +14 -14 fptools/ghc/compiler/types/FunDeps.lhs
1.34 +9 -8 fptools/ghc/compiler/types/Generics.lhs
1.34 +15 -13 fptools/ghc/compiler/types/InstEnv.lhs
1.15 +12 -5 fptools/ghc/compiler/types/Kind.lhs
1.74 +96 -85 fptools/ghc/compiler/types/TyCon.lhs
1.124 +229 -8 fptools/ghc/compiler/types/Type.lhs
1.37 +5 -8 fptools/ghc/compiler/types/TypeRep.lhs
1.61 +9 -8 fptools/ghc/compiler/utils/Outputable.lhs
1.26 +5 -3 fptools/ghc/compiler/utils/Panic.lhs
1.39 +14 -4 fptools/ghc/compiler/utils/UniqFM.lhs
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc