[commit: ghc] imp-param-class: Remove the IPName type, and the implicit parameter name cache. (ecd9b7e)

Iavor Diatchki diatchki at galois.com
Tue May 29 00:40:41 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : imp-param-class

http://hackage.haskell.org/trac/ghc/changeset/ecd9b7e094fcf95d5c8f03f58938b490e9c4a28d

>---------------------------------------------------------------

commit ecd9b7e094fcf95d5c8f03f58938b490e9c4a28d
Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
Date:   Mon May 28 15:01:25 2012 -0700

    Remove the IPName type, and the implicit parameter name cache.

>---------------------------------------------------------------

 compiler/basicTypes/BasicTypes.lhs |   28 ----------------------------
 compiler/basicTypes/Unique.lhs     |    3 ---
 compiler/iface/IfaceEnv.lhs        |    4 +---
 compiler/main/HscTypes.lhs         |   10 ++--------
 compiler/types/TypeRep.lhs         |    5 -----
 5 files changed, 3 insertions(+), 47 deletions(-)

diff --git a/compiler/basicTypes/BasicTypes.lhs b/compiler/basicTypes/BasicTypes.lhs
index c6226ca..c8af037 100644
--- a/compiler/basicTypes/BasicTypes.lhs
+++ b/compiler/basicTypes/BasicTypes.lhs
@@ -39,8 +39,6 @@ module BasicTypes(
 	negateFixity, funTyFixity,
 	compareFixity,
 
-	IPName(..), ipNameName, mapIPName,
-
 	RecFlag(..), isRec, isNonRec, boolToRecFlag,
 
 	RuleName,
@@ -167,32 +165,6 @@ instance Outputable WarningTxt where
 
 %************************************************************************
 %*									*
-\subsection{Implicit parameter identity}
-%*									*
-%************************************************************************
-
-The @IPName@ type is here because it is used in TypeRep (i.e. very
-early in the hierarchy), but also in HsSyn.
-
-\begin{code}
-newtype IPName name = IPName name	-- ?x
-  deriving( Eq, Data, Typeable )
-
-instance Functor IPName where
-    fmap = mapIPName
-
-ipNameName :: IPName name -> name
-ipNameName (IPName n) = n
-
-mapIPName :: (a->b) -> IPName a -> IPName b
-mapIPName f (IPName n) = IPName (f n)
-
-instance Outputable name => Outputable (IPName name) where
-    ppr (IPName n) = char '?' <> ppr n -- Ordinary implicit parameters
-\end{code}
-
-%************************************************************************
-%*									*
 		Rules
 %*									*
 %************************************************************************
diff --git a/compiler/basicTypes/Unique.lhs b/compiler/basicTypes/Unique.lhs
index f99a50c..9e8ac8a 100644
--- a/compiler/basicTypes/Unique.lhs
+++ b/compiler/basicTypes/Unique.lhs
@@ -178,9 +178,6 @@ instance Uniquable FastString where
 
 instance Uniquable Int where
  getUnique i = mkUniqueGrimily i
-
-instance Uniquable n => Uniquable (IPName n) where
-  getUnique (IPName n) = getUnique n
 \end{code}
 
 
diff --git a/compiler/iface/IfaceEnv.lhs b/compiler/iface/IfaceEnv.lhs
index f599318..3220158 100644
--- a/compiler/iface/IfaceEnv.lhs
+++ b/compiler/iface/IfaceEnv.lhs
@@ -45,7 +45,6 @@ import Outputable
 import Exception     ( evaluate )
 
 import Data.IORef    ( atomicModifyIORef, readIORef )
-import qualified Data.Map as Map
 \end{code}
 
 
@@ -232,8 +231,7 @@ mkNameCacheUpdater = do
 initNameCache :: UniqSupply -> [Name] -> NameCache
 initNameCache us names
   = NameCache { nsUniqs = us,
-		nsNames = initOrigNames names,
-                nsIPs   = Map.empty }
+		nsNames = initOrigNames names }
 
 initOrigNames :: [Name] -> OrigNameCache
 initOrigNames names = foldl extendOrigNameCache emptyModuleEnv names
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index 1c8276d..66f6c4b 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -73,7 +73,7 @@ module HscTypes (
         -- * Information on imports and exports
         WhetherHasOrphans, IsBootInterface, Usage(..),
         Dependencies(..), noDependencies,
-        NameCache(..), OrigNameCache, OrigIParamCache,
+        NameCache(..), OrigNameCache,
         IfaceExport,
 
         -- * Warnings
@@ -162,7 +162,6 @@ import Util
 import Control.Monad    ( mplus, guard, liftM, when )
 import Data.Array       ( Array, array )
 import Data.IORef
-import Data.Map         ( Map )
 import Data.Time
 import Data.Word
 import Data.Typeable    ( Typeable )
@@ -1763,17 +1762,12 @@ its binding site, we fix it up.
 data NameCache
  = NameCache {  nsUniqs :: UniqSupply,
                 -- ^ Supply of uniques
-                nsNames :: OrigNameCache,
+                nsNames :: OrigNameCache
                 -- ^ Ensures that one original name gets one unique
-                nsIPs   :: OrigIParamCache
-                -- ^ Ensures that one implicit parameter name gets one unique
    }
 
 -- | Per-module cache of original 'OccName's given 'Name's
 type OrigNameCache   = ModuleEnv (OccEnv Name)
-
--- | Module-local cache of implicit parameter 'OccName's given 'Name's
-type OrigIParamCache = Map FastString (IPName Name)
 \end{code}
 
 
diff --git a/compiler/types/TypeRep.lhs b/compiler/types/TypeRep.lhs
index 787648a..e2cf2d8 100644
--- a/compiler/types/TypeRep.lhs
+++ b/compiler/types/TypeRep.lhs
@@ -552,11 +552,6 @@ instance Outputable Type where
 instance Outputable TyLit where
    ppr = pprTyLit
 
-instance Outputable name => OutputableBndr (IPName name) where
-    pprBndr _ n   = ppr n	-- Simple for now
-    pprInfixOcc  n = ppr n 
-    pprPrefixOcc n = ppr n 
-
 ------------------
 	-- OK, here's the main printer
 





More information about the Cvs-ghc mailing list