Skip to content
Snippets Groups Projects
Commit 788faebb authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

[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
parent 6a44ce76
No related merge requests found
Showing
with 164 additions and 205 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment