Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
2d655062
Commit
2d655062
authored
10 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Patches
Plain Diff
-Wall police.
GHC HEAD now warns about redundant constraints.
parent
26017fe4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/Distribution/Simple/PackageIndex.hs
+7
-7
7 additions, 7 deletions
Cabal/Distribution/Simple/PackageIndex.hs
with
7 additions
and
7 deletions
Cabal/Distribution/Simple/PackageIndex.hs
+
7
−
7
View file @
2d655062
...
...
@@ -339,7 +339,7 @@ allPackagesBySourcePackageId (PackageIndex _ pnames) =
-- Since multiple package DBs mask each other by 'InstalledPackageId',
-- then we get back at most one package.
--
lookupInstalledPackageId
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
InstalledPackageId
lookupInstalledPackageId
::
PackageIndex
a
->
InstalledPackageId
->
Maybe
a
lookupInstalledPackageId
(
PackageIndex
pids
_
)
pid
=
Map
.
lookup
pid
pids
...
...
@@ -350,7 +350,7 @@ lookupInstalledPackageId (PackageIndex pids _) pid = Map.lookup pid pids
-- but different 'InstalledPackageId'. They are returned in order of
-- preference, with the most preferred first.
--
lookupSourcePackageId
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
PackageId
->
[
a
]
lookupSourcePackageId
::
PackageIndex
a
->
PackageId
->
[
a
]
lookupSourcePackageId
(
PackageIndex
_
pnames
)
pkgid
=
case
Map
.
lookup
(
packageName
pkgid
)
pnames
of
Nothing
->
[]
...
...
@@ -360,7 +360,7 @@ lookupSourcePackageId (PackageIndex _ pnames) pkgid =
-- | Convenient alias of 'lookupSourcePackageId', but assuming only
-- one package per package ID.
lookupPackageId
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
PackageId
->
Maybe
a
lookupPackageId
::
PackageIndex
a
->
PackageId
->
Maybe
a
lookupPackageId
index
pkgid
=
case
lookupSourcePackageId
index
pkgid
of
[]
->
Nothing
[
pkg
]
->
Just
pkg
...
...
@@ -368,7 +368,7 @@ lookupPackageId index pkgid = case lookupSourcePackageId index pkgid of
-- | Does a lookup by source package name.
--
lookupPackageName
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
PackageName
lookupPackageName
::
PackageIndex
a
->
PackageName
->
[(
Version
,
[
a
])]
lookupPackageName
(
PackageIndex
_
pnames
)
name
=
case
Map
.
lookup
name
pnames
of
...
...
@@ -381,7 +381,7 @@ lookupPackageName (PackageIndex _ pnames) name =
-- We get back any number of versions of the specified package name, all
-- satisfying the version range constraint.
--
lookupDependency
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
Dependency
lookupDependency
::
PackageIndex
a
->
Dependency
->
[(
Version
,
[
a
])]
lookupDependency
(
PackageIndex
_
pnames
)
(
Dependency
name
versionRange
)
=
case
Map
.
lookup
name
pnames
of
...
...
@@ -406,7 +406,7 @@ lookupDependency (PackageIndex _ pnames) (Dependency name versionRange) =
-- packages. The list of ambiguous results is split by exact package name. So
-- it is a non-empty list of non-empty lists.
--
searchByName
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
String
->
SearchResult
[
a
]
searchByName
::
PackageIndex
a
->
String
->
SearchResult
[
a
]
searchByName
(
PackageIndex
_
pnames
)
name
=
case
[
pkgs
|
pkgs
@
(
PackageName
name'
,
_
)
<-
Map
.
toList
pnames
,
lowercase
name'
==
lname
]
of
...
...
@@ -423,7 +423,7 @@ data SearchResult a = None | Unambiguous a | Ambiguous [a]
--
-- That is, all packages that contain the given string in their name.
--
searchByNameSubstring
::
HasInstalledPackageId
a
=>
PackageIndex
a
->
String
->
[
a
]
searchByNameSubstring
::
PackageIndex
a
->
String
->
[
a
]
searchByNameSubstring
(
PackageIndex
_
pnames
)
searchterm
=
[
pkg
|
(
PackageName
name
,
pvers
)
<-
Map
.
toList
pnames
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment