[project @ 2001-08-04 06:11:24 by ken]
[ghc-hetmet.git] / ghc / compiler / utils / FiniteMap.lhs
index d4e4931..c2c34fb 100644 (file)
@@ -1,4 +1,4 @@
-%
+
 % (c) The AQUA Project, Glasgow University, 1994-1998
 %
 \section[FiniteMap]{An implementation of finite maps}
@@ -57,11 +57,10 @@ module FiniteMap (
 #define OUTPUTABLE_key {--}
 #endif
 
-import {-# SOURCE #-} Name ( Name )
 import GlaExts
-import FastString
 import Maybes
 import Bag       ( Bag, foldrBag )
+import Util
 import Outputable
 
 #if ! OMIT_NATIVE_CODEGEN
@@ -222,7 +221,7 @@ addToFM_C combiner (Branch key elt size fm_l fm_r) new_key new_elt
 addListToFM fm key_elt_pairs = addListToFM_C (\ old new -> new) fm key_elt_pairs
 
 addListToFM_C combiner fm key_elt_pairs
-  = foldl add fm key_elt_pairs -- foldl adds from the left
+  = foldl' add fm key_elt_pairs        -- foldl adds from the left
   where
     add fmap (key,elt) = addToFM_C combiner fmap key elt
 \end{code}
@@ -235,7 +234,7 @@ delFromFM (Branch key elt size fm_l fm_r) del_key
        LT -> mkBalBranch key elt (delFromFM fm_l del_key) fm_r
        EQ -> glueBal fm_l fm_r
 
-delListFromFM fm keys = foldl delFromFM fm keys
+delListFromFM fm keys = foldl' delFromFM fm keys
 \end{code}
 
 %************************************************************************
@@ -587,8 +586,6 @@ glueVBal fm_l@(Branch key_l elt_l _ fm_ll fm_lr)
   | otherwise          -- We now need the same two cases as in glueBal above.
   = glueBal fm_l fm_r
   where
-    (mid_key_l,mid_elt_l) = findMax fm_l
-    (mid_key_r,mid_elt_r) = findMin fm_r
     size_l = sizeFM fm_l
     size_r = sizeFM fm_r
 \end{code}
@@ -682,7 +679,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
@@ -744,4 +743,6 @@ When the FiniteMap module is used in GHC, we specialise it for
     #-}
 
 #endif {- compiling with ghc and have specialiser -}
+
+#endif {- 0 -}
 \end{code}