Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
6e411b79
Commit
6e411b79
authored
Sep 04, 2008
by
Duncan Coutts
Browse files
Fix to compile with base-1.0:Data.List
which did not have isInfixOf
parent
c434a767
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/PackageIndex.hs
View file @
6e411b79
...
...
@@ -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.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment