projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2055546
)
[project @ 2003-05-19 15:11:15 by simonpj]
author
simonpj
<unknown>
Mon, 19 May 2003 15:11:15 +0000
(15:11 +0000)
committer
simonpj
<unknown>
Mon, 19 May 2003 15:11:15 +0000
(15:11 +0000)
Comments only
ghc/compiler/typecheck/TcMType.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/typecheck/TcMType.lhs
b/ghc/compiler/typecheck/TcMType.lhs
index
3d9f210
..
f2c900b
100644
(file)
--- 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}
%************************************************************************
\begin{code}
+-- Enumerate the contexts in which a "source type", <S>, 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
data SourceTyCtxt
= ClassSCCtxt Name -- Superclasses of clas
- | SigmaCtxt -- Context of a normal for-all type
- | DataTyCtxt Name -- Context of a data decl
+ -- class <S> => C a where ...
+ | SigmaCtxt -- Theta part of a normal for-all type
+ -- f :: <S> => a -> a
+ | DataTyCtxt Name -- Theta part of a data decl
+ -- data <S> => T a = MkT a
| TypeCtxt -- Source type in an ordinary type
| TypeCtxt -- Source type in an ordinary type
+ -- f :: N a -> N a
| InstThetaCtxt -- Context of an instance decl
| InstThetaCtxt -- Context of an instance decl
+ -- instance <S> => C [a] where ...
| InstHeadCtxt -- Head of an instance decl
| 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")
pprSourceTyCtxt (ClassSCCtxt c) = ptext SLIT("the super-classes of class") <+> quotes (ppr c)
pprSourceTyCtxt SigmaCtxt = ptext SLIT("the context of a polymorphic type")