From 184a569c5f5fe6e2eed73b2cff35722918c44efd Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Fri, 24 Aug 2018 08:14:15 +0100 Subject: Clean up TcHsSyn.zonkEnv Triggered by Trac #15552, I'd been looking at ZonkEnv in TcHsSyn. This patch does some minor refactoring * Make ZonkEnv into a record with named fields, and use them. (I'm planning to add a new field, for TyCons, so this prepares the way.) * Replace UnboundTyVarZonker (a higer order function) with the simpler and more self-descriptive ZonkFlexi data type, below. It's just much more perspicuous and direct, and (I suspect) a tiny bit faster too -- no unknown function calls. data ZonkFlexi -- See Note [Un-unified unification variables] = DefaultFlexi -- Default unbound unificaiton variables to Any | SkolemiseFlexi -- Skolemise unbound unification variables -- See Note [Zonking the LHS of a RULE] | RuntimeUnkFlexi -- Used in the GHCi debugger There was one knock-on effect in the GHCi debugger -- the RuntimeUnkFlexi case. Somehow previously, these RuntimeUnk variables were sometimes getting SystemNames (and hence printed as 'a0', 'a1', etc) and sometimes not (and hence printed as 'a', 'b' etc). I'm not sure precisely why, but the new behaviour seems more uniform, so I just accepted the (small) renaming wibbles in some ghci.debugger tests. I had a quick look at perf: any changes are tiny. --- testsuite/tests/ghci.debugger/scripts/print019.stdout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/tests/ghci.debugger/scripts/print019.stdout') diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stdout b/testsuite/tests/ghci.debugger/scripts/print019.stdout index aea474019d..932fd540c3 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print019.stdout @@ -1,4 +1,4 @@ -a = O (_t1::a) +a = O (_t1::a0) b = O (_t2::a1) () _t1 = 'a' -- cgit v1.2.1