From a4c53e3b00caacf5d103cf4f34017d932971ab67 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 15 Feb 2021 12:01:11 -0500 Subject: 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. --- compiler/GHC/Core/Map/Type.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- cgit v1.2.1