[project @ 2002-10-09 17:08:18 by malcolm]
[ghc-base.git] / Data / List.hs
index a6bff9b..398e8b2 100644 (file)
 
 module Data.List
    ( 
+#ifdef __NHC__
+     [] (..)
+   ,
+#endif
      elemIndex        -- :: (Eq a) => a -> [a] -> Maybe Int
    , elemIndices       -- :: (Eq a) => a -> [a] -> [Int]
 
@@ -132,6 +136,7 @@ module Data.List
 
    ) where
 
+import Prelude hiding (Maybe(..))
 import Data.Maybe
 
 #ifdef __GLASGOW_HASKELL__
@@ -161,19 +166,15 @@ findIndex p     = listToMaybe . findIndices p
 
 findIndices      :: (a -> Bool) -> [a] -> [Int]
 
-#ifdef USE_REPORT_PRELUDE
+#if defined(USE_REPORT_PRELUDE) || !defined(__GLASGOW_HASKELL__)
 findIndices p xs = [ i | (x,i) <- zip xs [0..], p x]
 #else
-#ifdef __HUGS__
-findIndices p xs = [ i | (x,i) <- zip xs [0..], p x]
-#else 
 -- Efficient definition
 findIndices p ls = loop 0# ls
                 where
                   loop _ [] = []
                   loop n (x:xs) | p x       = I# n : loop (n +# 1#) xs
                                 | otherwise = loop (n +# 1#) xs
-#endif  /* __HUGS__ */
 #endif  /* USE_REPORT_PRELUDE */
 
 isPrefixOf              :: (Eq a) => [a] -> [a] -> Bool