[project @ 2002-02-07 14:06:00 by simonpj]
authorsimonpj <unknown>
Thu, 7 Feb 2002 14:06:01 +0000 (14:06 +0000)
committersimonpj <unknown>
Thu, 7 Feb 2002 14:06:01 +0000 (14:06 +0000)
commitad552fe28f05107378eec34e13d30b5318339567
tree8385ebb75c6bf39b89ef507778fab7e1497ca052
parent5df7aa32b5736e36a2a56c59d8d8a887987872f6
[project @ 2002-02-07 14:06:00 by simonpj]
-------------------------------------------
Improve the "stragely-kinded tyvar" problem
-------------------------------------------

When the type checker finds a type variable with no binding,
which means it can be instantiated with an arbitrary type, it
usually instantiates it to Void.  Eg.

length []
===>
length Void (Nil Void)

But in really obscure programs, the type variable might have
a kind other than *, so we need to invent a suitably-kinded type.

This commit uses
Void for kind *
List for kind *->*
Tuple for kind *->...*->*

which deals with most cases.  (Previously, it only dealt with
kind *.)

In the other cases, it just makes up a TyCon with a suitable
kind.  If this gets into an interface file, anyone reading that
file won't understand it.  This is fixable (by making the client
of the interface file make up a TyCon too) but it is tiresome and
never happens, so I am leaving it.

Most of the added lines are comments.
ghc/compiler/typecheck/TcMType.lhs
ghc/compiler/typecheck/TcType.lhs
ghc/compiler/types/Type.lhs