From cb9e4b09b94913465cee27a68a384ff8e20aa191 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 26 Jul 2005 08:31:21 +0000 Subject: [PATCH] [project @ 2005-07-26 08:31:21 by simonpj] When trimming type constructors for export, no need to trim enumerations, because they don't give rise to any further exported things. (Minor improvement: no need to merge) --- ghc/compiler/main/TidyPgm.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/main/TidyPgm.lhs b/ghc/compiler/main/TidyPgm.lhs index 62a2c82..ef3864b 100644 --- a/ghc/compiler/main/TidyPgm.lhs +++ b/ghc/compiler/main/TidyPgm.lhs @@ -40,7 +40,7 @@ import Type ( tidyTopType ) import TcType ( isFFITy ) import DataCon ( dataConName, dataConFieldLabels, dataConWrapId_maybe ) import TyCon ( TyCon, makeTyConAbstract, tyConDataCons, isNewTyCon, - newTyConRep, tyConSelIds, isAlgTyCon ) + newTyConRep, tyConSelIds, isAlgTyCon, isEnumerationTyCon ) import Class ( classSelIds ) import Module ( Module ) import HscTypes ( HscEnv(..), NameCache( nsUniqs ), CgGuts(..), @@ -349,6 +349,9 @@ mustExposeTyCon :: NameSet -- Exports mustExposeTyCon exports tc | not (isAlgTyCon tc) -- Synonyms = True + | isEnumerationTyCon tc -- For an enumeration, exposing the constructors + = True -- won't lead to the need for further exposure + -- (This includes data types with no constructors.) | otherwise -- Newtype, datatype = any exported_con (tyConDataCons tc) -- Expose rep if any datacon or field is exported -- 1.7.10.4