summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-02-15 12:01:11 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-18 13:47:32 -0500
commita4c53e3b00caacf5d103cf4f34017d932971ab67 (patch)
tree31dfc9613a431b9dcdb367a25ef8c7b95a32498c
parentb5db34576d9b659366b2790ef98e08a854721ef5 (diff)
downloadhaskell-a4c53e3b00caacf5d103cf4f34017d932971ab67.tar.gz
TypeMap: Use mkTyConTy instead of TyConApp constructor
This allows TypeMap to benefit from the nullary TyConApp sharing optimisation described in Note [Sharing nullary TyConApps] in GHC.Core.TyCon.
-rw-r--r--compiler/GHC/Core/Map/Type.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Map/Type.hs b/compiler/GHC/Core/Map/Type.hs
index 050d19cba5..32b3fe054b 100644
--- a/compiler/GHC/Core/Map/Type.hs
+++ b/compiler/GHC/Core/Map/Type.hs
@@ -165,7 +165,7 @@ trieMapView ty
-- First check for TyConApps that need to be expanded to
-- AppTy chains.
| Just (tc, tys@(_:_)) <- tcSplitTyConApp_maybe ty
- = Just $ foldl' AppTy (TyConApp tc []) tys
+ = Just $ foldl' AppTy (mkTyConTy tc) tys
-- Then resolve any remaining nullary synonyms.
| Just ty' <- tcView ty = Just ty'