Fix #12442.
authorRichard Eisenberg <rae@cs.brynmawr.edu>
Wed, 27 Jul 2016 20:41:50 +0000 (16:41 -0400)
committerRichard Eisenberg <rae@cs.brynmawr.edu>
Fri, 23 Sep 2016 13:50:18 +0000 (09:50 -0400)
commit9766b0c81476c208b2b29ff66d97251209a79707
tree9d51e67e3237853ff065c9d884f4131d219da6bf
parent3a17916bb5fd4bda9d21359a82f5b5f38cc0fdad
Fix #12442.

The problem is described in the ticket.

This patch adds new variants of the access points to the pure
unifier that allow unification of types only when the caller
wants this behavior. (The unifier used to also unify kinds.)
This behavior is appropriate when the kinds are either already
known to be the same, or the list of types provided are a
list of well-typed arguments to some type constructor. In the
latter case, unifying earlier types in the list will unify the
kinds of any later (dependent) types.

At use sites, I went through and chose the unification function
according to the criteria above.

This patch includes some modest performance improvements as we
are now doing less work.
compiler/ghci/RtClosureInspect.hs
compiler/specialise/Rules.hs
compiler/typecheck/FunDeps.hs
compiler/typecheck/TcSimplify.hs
compiler/types/Unify.hs
testsuite/tests/dependent/should_compile/T12442.hs [new file with mode: 0644]
testsuite/tests/dependent/should_compile/all.T
testsuite/tests/perf/compiler/all.T