Commit 6e411b79 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix to compile with base-1.0:Data.List

which did not have isInfixOf
parent c434a767
......@@ -65,7 +65,11 @@ import qualified Data.Tree as Tree
import qualified Data.Graph as Graph
import qualified Data.Array as Array
import Data.Array ((!))
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ < 606)
import Data.List (groupBy, sortBy, find, isPrefixOf, tails)
#else
import Data.List (groupBy, sortBy, find, isInfixOf)
#endif
import Data.Monoid (Monoid(..))
import Data.Maybe (isNothing, fromMaybe)
......@@ -82,6 +86,11 @@ import Text.Read
import qualified Text.Read.Lex as L
#endif
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ < 606)
isInfixOf :: (Eq a) => [a] -> [a] -> Bool
isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
#endif
-- | The collection of information about packages from one or more 'PackageDB's.
--
-- It can be searched effeciently by package name and version.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment