-
simonpj authored
---------------------------------- 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.
221b6b69