From 17cbca82618a7e031f14c28d85f040decad8baf1 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 25 Aug 1997 22:24:30 +0000 Subject: [PATCH] [project @ 1997-08-25 22:24:30 by sof] Removed use of COMPILING_GHC; removed intersectLists from export list --- ghc/compiler/utils/ListSetOps.lhs | 41 +++++++++---------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/ghc/compiler/utils/ListSetOps.lhs b/ghc/compiler/utils/ListSetOps.lhs index 3917247..d2737a4 100644 --- a/ghc/compiler/utils/ListSetOps.lhs +++ b/ghc/compiler/utils/ListSetOps.lhs @@ -4,28 +4,29 @@ \section[ListSetOps]{Set-like operations on lists} \begin{code} -#ifdef COMPILING_GHC #include "HsVersions.h" -#endif module ListSetOps ( unionLists, - intersectLists, + --UNUSED: intersectLists, minusList -#ifndef COMPILING_GHC - , disjointLists, intersectingLists -#endif + ) where -#if defined(COMPILING_GHC) IMP_Ubiq(){-uitous-} import Util ( isIn, isn'tIn ) + +#if __GLASGOW_HASKELL__ >= 202 +import List #endif \end{code} \begin{code} unionLists :: (Eq a) => [a] -> [a] -> [a] +#ifdef REALLY_HASKELL_1_3 +unionLists = union +#else unionLists [] [] = [] unionLists [] b = b unionLists a [] = a @@ -33,12 +34,10 @@ 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 +{- UNUSED intersectLists :: (Eq a) => [a] -> [a] -> [a] intersectLists [] [] = [] intersectLists [] b = [] @@ -47,11 +46,8 @@ 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 +-} \end{code} Everything in the first list that is not in the second list: @@ -59,23 +55,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} -- 1.7.10.4