[commit: ghc] wip/T12618: Handle ConApp in more points in the Specializer (74d26f8)
git at git.haskell.org
git at git.haskell.org
Tue Oct 18 17:55:08 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/T12618
Link : http://ghc.haskell.org/trac/ghc/changeset/74d26f835f7107fee3748deaa07d23705fd715e1/ghc
>---------------------------------------------------------------
commit 74d26f835f7107fee3748deaa07d23705fd715e1
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Tue Oct 18 13:51:58 2016 -0400
Handle ConApp in more points in the Specializer
>---------------------------------------------------------------
74d26f835f7107fee3748deaa07d23705fd715e1
compiler/specialise/Rules.hs | 1 +
compiler/specialise/SpecConstr.hs | 1 +
2 files changed, 2 insertions(+)
diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs
index 6297d88..a2cf5ae 100644
--- a/compiler/specialise/Rules.hs
+++ b/compiler/specialise/Rules.hs
@@ -209,6 +209,7 @@ roughTopName (Type ty) = case tcSplitTyConApp_maybe ty of
Just (tc,_) -> Just (getName tc)
Nothing -> Nothing
roughTopName (Coercion _) = Nothing
+roughTopName (ConApp dc _) = Just (dataConWorkId dc)
roughTopName (App f _) = roughTopName f
roughTopName (Var f) | isGlobalId f -- Note [Care with roughTopName]
, isDataConWorkId f || idArity f > 0
diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs
index dbc32e6..5c6944b 100644
--- a/compiler/specialise/SpecConstr.hs
+++ b/compiler/specialise/SpecConstr.hs
@@ -2106,6 +2106,7 @@ samePat (vs1, as1) (vs2, as2)
same (Lit l1) (Lit l2) = l1==l2
same (App f1 a1) (App f2 a2) = same f1 f2 && same a1 a2
+ same (ConApp dc1 args1) (ConApp dc2 args2) = dc1 == dc2 && all2 same args1 args2
same (Type {}) (Type {}) = True -- Note [Ignore type differences]
same (Coercion {}) (Coercion {}) = True
More information about the ghc-commits
mailing list