summaryrefslogtreecommitdiff
path: root/compiler/coreSyn
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2013-10-24 11:15:04 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2013-10-24 11:15:14 +0100
commit2650da2b8b744248c2529d8c5969b78cd97239d3 (patch)
tree1d110da719c3c5dd21af771cc8a51b45fda6c897 /compiler/coreSyn
parent1990c63ba5f4b701ed360d86dcdfe9c2b7da172b (diff)
downloadhaskell-2650da2b8b744248c2529d8c5969b78cd97239d3.tar.gz
Refactor the topNormaliseNewType story, fixing Trac #8467
A bit of a mess had accumulated, with unclear invariants. * Remove splitNewTypeRepCo_maybe, in favour of topNormaliseNewType_maybe (which had the same signature but behaved subtly differently). * Make topNormaliseNewType_maybe guaranteed to return a non-newtype if it says (Just ty). This is what was causing the loop in #8467 * Apply similar tidying up to FamInstEnv.topNormaliseType
Diffstat (limited to 'compiler/coreSyn')
-rw-r--r--compiler/coreSyn/CoreArity.lhs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/coreSyn/CoreArity.lhs b/compiler/coreSyn/CoreArity.lhs
index 9c0fd179ff..d0fa106295 100644
--- a/compiler/coreSyn/CoreArity.lhs
+++ b/compiler/coreSyn/CoreArity.lhs
@@ -902,7 +902,7 @@ mkEtaWW orig_n orig_expr in_scope orig_ty
-- Avoid free vars of the original expression
= go (n-1) subst' res_ty (EtaVar eta_id' : eis)
- | Just(ty',co) <- splitNewTypeRepCo_maybe ty
+ | Just (co, ty') <- topNormaliseNewType_maybe ty
= -- Given this:
-- newtype T = MkT ([T] -> Int)
-- Consider eta-expanding this