[project @ 2000-10-16 13:13:41 by sewardj]
[ghc-hetmet.git] / ghc / compiler / utils / FiniteMap.lhs
index abcdc2a..cb7da6d 100644 (file)
@@ -45,8 +45,6 @@ module FiniteMap (
        fmToList, keysFM, eltsFM
 
        , bagToFM
-       , FiniteSet, emptySet, mkSet, isEmptySet
-       , elementOf, setToList, union, insert, minusSet
 
     ) where
 
@@ -655,6 +653,10 @@ pprX (Branch key elt sz fm_l fm_r)
  = parens (hcat [pprX fm_l, space,
                      ppr key, space, int (IF_GHC(I# sz, sz)), space,
                      pprX fm_r])
+#else
+-- and when not debugging the package itself...
+instance (Outputable key, Outputable elt) => Outputable (FiniteMap key elt) where
+    ppr fm = ppr (fmToList fm)
 #endif
 
 #if 0
@@ -672,33 +674,6 @@ instance (Ord key, Ord elt) => Ord (FiniteMap key elt) where
 
 %************************************************************************
 %*                                                                     *
-\subsection{FiniteSets---a thin veneer}
-%*                                                                     *
-%************************************************************************
-
-\begin{code}
-type FiniteSet key = FiniteMap key ()
-emptySet       :: FiniteSet key
-mkSet          :: (Ord key OUTPUTABLE_key) => [key] -> FiniteSet key
-isEmptySet     :: FiniteSet key -> Bool
-elementOf      :: (Ord key OUTPUTABLE_key) => key -> FiniteSet key -> Bool
-minusSet       :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
-setToList      :: FiniteSet key -> [key]
-union          :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
-insert         :: (Ord key OUTPUTABLE_key) => FiniteSet key -> key -> FiniteSet key
-
-emptySet = emptyFM
-mkSet xs = listToFM [ (x, ()) | x <- xs]
-isEmptySet = isEmptyFM
-elementOf = elemFM
-minusSet  = minusFM
-setToList = keysFM
-union = plusFM
-insert s v = addToFM s v ()
-\end{code}
-
-%************************************************************************
-%*                                                                     *
 \subsection{Efficiency pragmas for GHC}
 %*                                                                     *
 %************************************************************************
@@ -707,7 +682,9 @@ When the FiniteMap module is used in GHC, we specialise it for
 \tr{Uniques}, for dastardly efficiency reasons.
 
 \begin{code}
-#if __GLASGOW_HASKELL__ && !defined(REALLY_HASKELL_1_3)
+#if 0
+
+#if __GLASGOW_HASKELL__
 
 {-# SPECIALIZE addListToFM
                :: FiniteMap (FAST_STRING, FAST_STRING) elt -> [((FAST_STRING, FAST_STRING),elt)] -> FiniteMap (FAST_STRING, FAST_STRING) elt
@@ -769,4 +746,6 @@ When the FiniteMap module is used in GHC, we specialise it for
     #-}
 
 #endif {- compiling with ghc and have specialiser -}
+
+#endif {- 0 -}
 \end{code}