[project @ 1998-04-06 18:38:36 by sof]
[ghc-hetmet.git] / ghc / compiler / utils / ListSetOps.lhs
index 3be4d89..92cbfc5 100644 (file)
@@ -6,48 +6,20 @@
 \begin{code}
 module ListSetOps (
        unionLists,
-       intersectLists,
+       --UNUSED: intersectLists,
        minusList
-#if ! defined(COMPILING_GHC)
-       , disjointLists, intersectingLists
-#endif
+
    ) where
 
-#if defined(COMPILING_GHC)
-import Ubiq{-uitous-}
+#include "HsVersions.h"
 
-import Util    ( isIn, isn'tIn )
-#endif
+import Util    ( isn'tIn )
+import List    ( union )
 \end{code}
 
 \begin{code}
 unionLists :: (Eq a) => [a] -> [a] -> [a]
-unionLists []     []           = []
-unionLists []     b            = b
-unionLists a      []           = a
-unionLists (a:as) b
-  | a `is_elem` b = unionLists as b
-  | otherwise     = a : unionLists as b
-  where
-#if defined(COMPILING_GHC)
-    is_elem = isIn "unionLists"
-#else
-    is_elem = elem
-#endif
-
-intersectLists :: (Eq a) => [a] -> [a] -> [a]
-intersectLists []     []               = []
-intersectLists []     b                        = []
-intersectLists a      []               = []
-intersectLists (a:as) b
-  | a `is_elem` b = a : intersectLists as b
-  | otherwise    = intersectLists as b
-  where
-#if defined(COMPILING_GHC)
-    is_elem = isIn "intersectLists"
-#else
-    is_elem = elem
-#endif
+unionLists = union
 \end{code}
 
 Everything in the first list that is not in the second list:
@@ -55,23 +27,6 @@ Everything in the first list that is not in the second list:
 minusList :: (Eq a) => [a] -> [a] -> [a]
 minusList xs ys = [ x | x <- xs, x `not_elem` ys]
   where
-#if defined(COMPILING_GHC)
     not_elem = isn'tIn "minusList"
-#else
-    not_elem = notElem
-#endif
-\end{code}
-
-\begin{code}
-#if ! defined(COMPILING_GHC)
-
-disjointLists, intersectingLists :: Eq a => [a] -> [a] -> Bool
-
-disjointLists []     bs = True
-disjointLists (a:as) bs
-  | a `elem` bs = False
-  | otherwise   = disjointLists as bs
 
-intersectingLists xs ys = not (disjointLists xs ys)
-#endif
 \end{code}