summaryrefslogtreecommitdiff
path: root/compiler/specialise
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@cs.brynmawr.edu>2016-07-27 16:41:50 -0400
committerRichard Eisenberg <rae@cs.brynmawr.edu>2016-09-23 09:50:18 -0400
commit9766b0c81476c208b2b29ff66d97251209a79707 (patch)
tree9d51e67e3237853ff065c9d884f4131d219da6bf /compiler/specialise
parent3a17916bb5fd4bda9d21359a82f5b5f38cc0fdad (diff)
downloadhaskell-9766b0c81476c208b2b29ff66d97251209a79707.tar.gz
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.
Diffstat (limited to 'compiler/specialise')
-rw-r--r--compiler/specialise/Rules.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index 48684240d6..7909bdc818 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -51,7 +51,7 @@ import Name ( Name, NamedThing(..), nameIsLocalOrFrom )
import NameSet
import NameEnv
import UniqFM
-import Unify ( ruleMatchTyX )
+import Unify ( ruleMatchTyKiX )
import BasicTypes ( Activation, CompilerPhase, isActive, pprRuleName )
import StaticFlags ( opt_PprStyle_Debug )
import DynFlags ( DynFlags )
@@ -947,7 +947,7 @@ match_ty :: RuleMatchEnv
match_ty renv subst ty1 ty2
= do { tv_subst'
- <- Unify.ruleMatchTyX (rv_tmpls renv) (rv_lcl renv) tv_subst ty1 ty2
+ <- Unify.ruleMatchTyKiX (rv_tmpls renv) (rv_lcl renv) tv_subst ty1 ty2
; return (subst { rs_tv_subst = tv_subst' }) }
where
tv_subst = rs_tv_subst subst