[project @ 2003-04-16 13:34:13 by simonpj]
authorsimonpj <unknown>
Wed, 16 Apr 2003 13:34:17 +0000 (13:34 +0000)
committersimonpj <unknown>
Wed, 16 Apr 2003 13:34:17 +0000 (13:34 +0000)
commit221b6b69d68ad9b8de2948b6af40d1c08ffaa0c6
tree0d48c836364c08f26b8e4b81bd3ced18c4781ac2
parent91af47d422942336b6e9f93d1250e6385e252a95
[project @ 2003-04-16 13:34:13 by simonpj]
----------------------------------
 Use the Infer/Check idea for typechecking higher-rank types
----------------------------------

The main idea is that

data Expected ty = Infer (TcRef ty) | Check ty

tcMonoExpr :: Expr -> Expected TcRhoType -> TcM Expra

This "Expected" type tells tcMonoExpr whether it's doing inference or
checking.  It replaces the "HoleTv" flavour of type variable.

This actually leads to slightly more lines of code, but it's much
clearer, and the new type distinctions showed up several subtle bugs
in the previous implementation.  It all arose out of writing the
prototype implementation for the paper.

Error messages wibble around a little bit.  I'm not quite certain why!  But the
changes look like improvements to me.
14 files changed:
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcBinds.lhs
ghc/compiler/typecheck/TcExpr.hi-boot-6
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcForeign.lhs
ghc/compiler/typecheck/TcMType.lhs
ghc/compiler/typecheck/TcMatches.hi-boot-6
ghc/compiler/typecheck/TcMatches.lhs
ghc/compiler/typecheck/TcPat.lhs
ghc/compiler/typecheck/TcRnDriver.lhs
ghc/compiler/typecheck/TcRules.lhs
ghc/compiler/typecheck/TcSplice.lhs
ghc/compiler/typecheck/TcType.lhs
ghc/compiler/typecheck/TcUnify.lhs