[project @ 2001-03-13 14:58:25 by simonpj]
authorsimonpj <unknown>
Tue, 13 Mar 2001 14:58:28 +0000 (14:58 +0000)
committersimonpj <unknown>
Tue, 13 Mar 2001 14:58:28 +0000 (14:58 +0000)
commit788faebb40b51d37e73ed94dfc99460d39a1a811
tree5aed135958315fcb297c1c4908440775fdbdf1ad
parent6a44ce76861d73d59badc8f8c17ffbd52eff17ba
[project @ 2001-03-13 14:58:25 by simonpj]
----------------
Nuke ClassContext
----------------

This commit tidies up a long-standing inconsistency in GHC.
The context of a class or instance decl used to be restricted
to predicates of the form
C t1 .. tn
with
type ClassContext = [(Class,[Type])]

but everywhere else in the compiler we used

type ThetaType = [PredType]
where PredType can be any sort of constraint (= predicate).

The inconsistency actually led to a crash, when compiling
class (?x::Int) => C a where {}

I've tidied all this up by nuking ClassContext altogether, and using
PredType throughout.  Lots of modified files, but all in
more-or-less trivial ways.

I've also added a check that the context of a class or instance
decl doesn't include a non-inheritable predicate like (?x::Int).

Other things

 * rename constructor 'Class' from type TypeRep.Pred to 'ClassP'
   (makes it easier to grep for)

 * rename constructor HsPClass  => HsClassP
      HsPIParam => HsIParam
37 files changed:
ghc/compiler/basicTypes/DataCon.lhs
ghc/compiler/basicTypes/MkId.lhs
ghc/compiler/coreSyn/Subst.lhs
ghc/compiler/deSugar/DsForeign.lhs
ghc/compiler/hsSyn/HsTypes.lhs
ghc/compiler/ilxGen/IlxGen.lhs
ghc/compiler/main/CodeOutput.lhs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/parser/ParseUtil.lhs
ghc/compiler/parser/RdrHsSyn.lhs
ghc/compiler/prelude/TysWiredIn.lhs
ghc/compiler/rename/ParseIface.y
ghc/compiler/rename/RnHsSyn.lhs
ghc/compiler/rename/RnSource.lhs
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcClassDcl.lhs
ghc/compiler/typecheck/TcDefaults.lhs
ghc/compiler/typecheck/TcDeriv.lhs
ghc/compiler/typecheck/TcEnv.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcInstDcls.lhs
ghc/compiler/typecheck/TcMonad.lhs
ghc/compiler/typecheck/TcMonoType.lhs
ghc/compiler/typecheck/TcPat.lhs
ghc/compiler/typecheck/TcSimplify.lhs
ghc/compiler/typecheck/TcTyClsDecls.lhs
ghc/compiler/typecheck/TcTyDecls.lhs
ghc/compiler/typecheck/TcType.lhs
ghc/compiler/typecheck/TcUnify.lhs
ghc/compiler/types/Class.lhs
ghc/compiler/types/FunDeps.lhs
ghc/compiler/types/PprType.lhs
ghc/compiler/types/TyCon.lhs
ghc/compiler/types/Type.lhs
ghc/compiler/types/TypeRep.hi-boot
ghc/compiler/types/TypeRep.hi-boot-5
ghc/compiler/types/TypeRep.lhs