summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2021-07-30 13:50:25 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-04 16:38:40 -0400
commit7a9d8803cfde3c42da4b27a7b89bdcb2ac870e3f (patch)
tree0d2e0dd78e719d93e276fff0a668e8315639ff45 /testsuite
parent477bc2dd6d506ece1c5c030f79f3934ff1922a5f (diff)
downloadhaskell-7a9d8803cfde3c42da4b27a7b89bdcb2ac870e3f.tar.gz
Use Reductions to keep track of rewritings
We define Reduction = Reduction Coercion !Type. A reduction of the form 'Reduction co new_ty' witnesses an equality ty ~co~> new_ty. That is, the rewriting happens left-to-right: the right-hand-side type of the coercion is the rewritten type, and the left-hand-side type the original type. Sticking to this convention makes the codebase more consistent, helping to avoid certain applications of SymCo. This replaces the parts of the codebase which represented reductions as pairs, (Coercion,Type) or (Type,Coercion). Reduction being strict in the Type argument improves performance in some programs that rewrite many type families (such as T9872). Fixes #20161 ------------------------- Metric Decrease: T5321Fun T9872a T9872b T9872c T9872d -------------------------
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/count-deps/CountDepsAst.stdout3
-rw-r--r--testsuite/tests/count-deps/CountDepsParser.stdout3
2 files changed, 4 insertions, 2 deletions
diff --git a/testsuite/tests/count-deps/CountDepsAst.stdout b/testsuite/tests/count-deps/CountDepsAst.stdout
index 184f20d7d0..bde8fc08da 100644
--- a/testsuite/tests/count-deps/CountDepsAst.stdout
+++ b/testsuite/tests/count-deps/CountDepsAst.stdout
@@ -1,4 +1,4 @@
-Found 274 Language.Haskell.Syntax module dependencies
+Found 275 Language.Haskell.Syntax module dependencies
GHC.Builtin.Names
GHC.Builtin.PrimOps
GHC.Builtin.Types
@@ -42,6 +42,7 @@ GHC.Core.Opt.OccurAnal
GHC.Core.PatSyn
GHC.Core.Ppr
GHC.Core.Predicate
+GHC.Core.Reduction
GHC.Core.Rules
GHC.Core.Seq
GHC.Core.SimpleOpt
diff --git a/testsuite/tests/count-deps/CountDepsParser.stdout b/testsuite/tests/count-deps/CountDepsParser.stdout
index a2ef4064f5..48c1791fed 100644
--- a/testsuite/tests/count-deps/CountDepsParser.stdout
+++ b/testsuite/tests/count-deps/CountDepsParser.stdout
@@ -1,4 +1,4 @@
-Found 280 GHC.Parser module dependencies
+Found 281 GHC.Parser module dependencies
GHC.Builtin.Names
GHC.Builtin.PrimOps
GHC.Builtin.Types
@@ -42,6 +42,7 @@ GHC.Core.Opt.OccurAnal
GHC.Core.PatSyn
GHC.Core.Ppr
GHC.Core.Predicate
+GHC.Core.Reduction
GHC.Core.Rules
GHC.Core.Seq
GHC.Core.SimpleOpt