projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b254336
)
FIX BUILD with ghc-6.4.x
author
Simon Marlow
<simonmar@microsoft.com>
Fri, 1 Feb 2008 11:43:02 +0000
(11:43 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Fri, 1 Feb 2008 11:43:02 +0000
(11:43 +0000)
utils/ghc-pkg/Main.hs
patch
|
blob
|
history
diff --git
a/utils/ghc-pkg/Main.hs
b/utils/ghc-pkg/Main.hs
index
6fa1e6b
..
936b309
100644
(file)
--- 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 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 )
unfoldr, break )
+#if __GLASGOW_HASKELL__ > 604
+import Data.List ( isInfixOf )
+#else
+import Data.List ( tails )
+#endif
import Control.Concurrent
#ifdef mingw32_HOST_OS
import Control.Concurrent
#ifdef mingw32_HOST_OS
@@
-1063,3
+1068,8
@@
installSignalHandlers = do
#else
return () -- nothing
#endif
#else
return () -- nothing
#endif
+
+#if __GLASGOW_HASKELL__ <= 604
+isInfixOf :: (Eq a) => [a] -> [a] -> Bool
+isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
+#endif