From 21c9699eb5175355db4c44643a58b3c532238400 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 1 Feb 2008 11:43:02 +0000 Subject: [PATCH] FIX BUILD with ghc-6.4.x --- utils/ghc-pkg/Main.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 6fa1e6b..936b309 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -48,8 +48,13 @@ import System.Exit ( exitWith, ExitCode(..) ) import System.Environment ( getArgs, getProgName, getEnv ) import System.IO import System.IO.Error (try) -import Data.List ( isPrefixOf, isSuffixOf, isInfixOf, intersperse, sortBy, nub, +import Data.List ( isPrefixOf, isSuffixOf, intersperse, sortBy, nub, unfoldr, break ) +#if __GLASGOW_HASKELL__ > 604 +import Data.List ( isInfixOf ) +#else +import Data.List ( tails ) +#endif import Control.Concurrent #ifdef mingw32_HOST_OS @@ -1063,3 +1068,8 @@ installSignalHandlers = do #else return () -- nothing #endif + +#if __GLASGOW_HASKELL__ <= 604 +isInfixOf :: (Eq a) => [a] -> [a] -> Bool +isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack) +#endif -- 1.7.10.4