From: simonpj Date: Mon, 19 May 2003 15:11:15 +0000 (+0000) Subject: [project @ 2003-05-19 15:11:15 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~896 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=143f478bd5ff1dc46472c44605bb0d9e08a942b1;p=ghc-hetmet.git [project @ 2003-05-19 15:11:15 by simonpj] Comments only --- diff --git a/ghc/compiler/typecheck/TcMType.lhs b/ghc/compiler/typecheck/TcMType.lhs index 3d9f210..f2c900b 100644 --- a/ghc/compiler/typecheck/TcMType.lhs +++ b/ghc/compiler/typecheck/TcMType.lhs @@ -744,13 +744,25 @@ kindErr kind = ptext SLIT("Expecting an ordinary type, but found a type of %************************************************************************ \begin{code} +-- Enumerate the contexts in which a "source type", , can occur +-- Eq a +-- or ?x::Int +-- or r <: {x::Int} +-- or (N a) where N is a newtype + data SourceTyCtxt = ClassSCCtxt Name -- Superclasses of clas - | SigmaCtxt -- Context of a normal for-all type - | DataTyCtxt Name -- Context of a data decl + -- class => C a where ... + | SigmaCtxt -- Theta part of a normal for-all type + -- f :: => a -> a + | DataTyCtxt Name -- Theta part of a data decl + -- data => T a = MkT a | TypeCtxt -- Source type in an ordinary type + -- f :: N a -> N a | InstThetaCtxt -- Context of an instance decl + -- instance => C [a] where ... | InstHeadCtxt -- Head of an instance decl + -- instance ... => Eq a where ... pprSourceTyCtxt (ClassSCCtxt c) = ptext SLIT("the super-classes of class") <+> quotes (ppr c) pprSourceTyCtxt SigmaCtxt = ptext SLIT("the context of a polymorphic type")