[project @ 2001-05-21 09:19:14 by simonpj]
authorsimonpj <unknown>
Mon, 21 May 2001 09:19:15 +0000 (09:19 +0000)
committersimonpj <unknown>
Mon, 21 May 2001 09:19:15 +0000 (09:19 +0000)
commitc7e7bc25c21e28651194d9d37a53a8820932fba7
tree974f2ddd02d1522d8b12f8ef57fc45333b15efb5
parent50146cd1a8a7d4db67f58bbea7ed4ca34a372d22
[project @ 2001-05-21 09:19:14 by simonpj]
-------------------------------
Improve pattern type-signatures
-------------------------------

The main effect of this commit is to implement the idea (originally
Marcin's suggestion) that type variables in pattern type signatures
are simply names for types; they don't have to name a type that is
itself a type variable.

For example

f :: Int -> Int
f (x::a) = let  y::a
y = x
   in x+y

is fine.  Here 'a' is a name for the type 'Int', and does not have
to be universally quantified.

I also took the opportunity to modularise the implementation of
pattern type-checking, mainly in TcMatches.  As a result pattern type
signatures should work in do-notation (which they didn't before).

ToDo: update documentation
ghc/compiler/typecheck/TcEnv.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcInstDcls.lhs
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcMonad.lhs
ghc/compiler/typecheck/TcMonoType.lhs
ghc/compiler/typecheck/TcRules.lhs
ghc/compiler/typecheck/TcType.lhs