Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Alex D
GHC
Commits
7a310c7b
Commit
7a310c7b
authored
12 years ago
by
Ian Lynagh
Browse files
Options
Downloads
Patches
Plain Diff
Small refactoring in ghc-pkg
parent
0c3a9679
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/ghc-pkg/Main.hs
+4
-6
4 additions, 6 deletions
utils/ghc-pkg/Main.hs
with
4 additions
and
6 deletions
utils/ghc-pkg/Main.hs
+
4
−
6
View file @
7a310c7b
...
@@ -1153,17 +1153,15 @@ describeField :: Verbosity -> [Flag] -> PackageArg -> [String] -> Bool -> IO ()
...
@@ -1153,17 +1153,15 @@ describeField :: Verbosity -> [Flag] -> PackageArg -> [String] -> Bool -> IO ()
describeField
verbosity
my_flags
pkgarg
fields
expand_pkgroot
=
do
describeField
verbosity
my_flags
pkgarg
fields
expand_pkgroot
=
do
(
_
,
_
,
flag_db_stack
)
<-
(
_
,
_
,
flag_db_stack
)
<-
getPkgDatabases
verbosity
False
True
{-use cache-}
expand_pkgroot
my_flags
getPkgDatabases
verbosity
False
True
{-use cache-}
expand_pkgroot
my_flags
fns
<-
toField
s
fields
fns
<-
mapM
toField
fields
ps
<-
findPackages
flag_db_stack
pkgarg
ps
<-
findPackages
flag_db_stack
pkgarg
mapM_
(
selectFields
fns
)
ps
mapM_
(
selectFields
fns
)
ps
where
showFun
=
if
FlagSimpleOutput
`
elem
`
my_flags
where
showFun
=
if
FlagSimpleOutput
`
elem
`
my_flags
then
showSimpleInstalledPackageInfoField
then
showSimpleInstalledPackageInfoField
else
showInstalledPackageInfoField
else
showInstalledPackageInfoField
toFields
[]
=
return
[]
toField
f
=
case
showFun
f
of
toFields
(
f
:
fs
)
=
case
showFun
f
of
Nothing
->
die
(
"unknown field: "
++
f
)
Nothing
->
die
(
"unknown field: "
++
f
)
Just
fn
->
return
fn
Just
fn
->
do
fns
<-
toFields
fs
return
(
fn
:
fns
)
selectFields
fns
pinfo
=
mapM_
(
\
fn
->
putStrLn
(
fn
pinfo
))
fns
selectFields
fns
pinfo
=
mapM_
(
\
fn
->
putStrLn
(
fn
pinfo
))
fns
...
...
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