Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2002-02-07 14:06:00 by simonpj] · ad552fe2
    Simon Peyton Jones authored
    -------------------------------------------
    	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.
    ad552fe2