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
448d37db
Commit
448d37db
authored
9 years ago
by
Duncan Coutts
Committed by
Mikhail Glushenkov
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move the ExtDependency type to the only module where it's used
Fewer shared types makes the code easier to grok and navigate.
parent
0be5efeb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/Distribution/Client/Dependency/Types.hs
+1
-16
1 addition, 16 deletions
cabal-install/Distribution/Client/Dependency/Types.hs
cabal-install/Distribution/Client/List.hs
+12
-3
12 additions, 3 deletions
cabal-install/Distribution/Client/List.hs
with
13 additions
and
19 deletions
cabal-install/Distribution/Client/Dependency/Types.hs
+
1
−
16
View file @
448d37db
...
...
@@ -13,8 +13,6 @@
-- Common types for dependency resolution.
-----------------------------------------------------------------------------
module
Distribution.Client.Dependency.Types
(
ExtDependency
(
..
),
PreSolver
(
..
),
Solver
(
..
),
DependencyResolver
,
...
...
@@ -48,9 +46,6 @@ import Data.Monoid
import
Distribution.Client.Types
(
OptionalStanza
(
..
),
SourcePackage
(
..
),
ConfiguredPackage
)
import
Distribution.Compat.ReadP
(
(
<++
)
)
import
qualified
Distribution.Compat.ReadP
as
Parse
(
pfail
,
munch1
)
import
Distribution.PackageDescription
...
...
@@ -61,7 +56,7 @@ import qualified Distribution.Client.PackageIndex as PackageIndex
(
PackageIndex
)
import
Distribution.Simple.PackageIndex
(
InstalledPackageIndex
)
import
Distribution.Package
(
Dependency
,
PackageName
,
InstalledPackageId
)
(
PackageName
)
import
Distribution.Version
(
VersionRange
,
simplifyVersionRange
)
import
Distribution.Compiler
...
...
@@ -76,16 +71,6 @@ import Text.PrettyPrint
import
Prelude
hiding
(
fail
)
-- | Covers source dependencies and installed dependencies in
-- one type.
data
ExtDependency
=
SourceDependency
Dependency
|
InstalledDependency
InstalledPackageId
instance
Text
ExtDependency
where
disp
(
SourceDependency
dep
)
=
disp
dep
disp
(
InstalledDependency
dep
)
=
disp
dep
parse
=
(
SourceDependency
`
fmap
`
parse
)
<++
(
InstalledDependency
`
fmap
`
parse
)
-- | All the solvers that can be selected.
data
PreSolver
=
AlwaysTopDown
|
AlwaysModular
|
Choose
...
...
This diff is collapsed.
Click to expand it.
cabal-install/Distribution/Client/List.hs
+
12
−
3
View file @
448d37db
...
...
@@ -15,7 +15,8 @@ module Distribution.Client.List (
import
Distribution.Package
(
PackageName
(
..
),
Package
(
..
),
packageName
,
packageVersion
,
Dependency
(
..
),
simplifyDependency
)
,
Dependency
(
..
),
simplifyDependency
,
InstalledPackageId
)
import
Distribution.ModuleName
(
ModuleName
)
import
Distribution.License
(
License
)
import
qualified
Distribution.InstalledPackageInfo
as
Installed
...
...
@@ -44,7 +45,7 @@ import Distribution.Text
import
Distribution.Client.Types
(
SourcePackage
(
..
),
Repo
,
SourcePackageDb
(
..
)
)
import
Distribution.Client.Dependency.Types
(
PackageConstraint
(
..
)
,
ExtDependency
(
..
)
)
(
PackageConstraint
(
..
)
)
import
Distribution.Client.Targets
(
UserTarget
,
resolveUserTargets
,
PackageSpecifier
(
..
)
)
import
Distribution.Client.Setup
...
...
@@ -292,6 +293,11 @@ data PackageDisplayInfo = PackageDisplayInfo {
haveTarball
::
Bool
}
-- | Covers source dependencies and installed dependencies in
-- one type.
data
ExtDependency
=
SourceDependency
Dependency
|
InstalledDependency
InstalledPackageId
showPackageSummaryInfo
::
PackageDisplayInfo
->
String
showPackageSummaryInfo
pkginfo
=
renderStyle
(
style
{
lineLength
=
80
,
ribbonsPerLine
=
1
})
$
...
...
@@ -344,7 +350,7 @@ showPackageDetailedInfo pkginfo =
,
entry
"Source repo"
sourceRepo
orNotSpecified
text
,
entry
"Executables"
executables
hideIfNull
(
commaSep
text
)
,
entry
"Flags"
flags
hideIfNull
(
commaSep
dispFlag
)
,
entry
"Dependencies"
dependencies
hideIfNull
(
commaSep
disp
)
,
entry
"Dependencies"
dependencies
hideIfNull
(
commaSep
disp
ExtDep
)
,
entry
"Documentation"
haddockHtml
showIfInstalled
text
,
entry
"Cached"
haveTarball
alwaysShow
dispYesNo
,
if
not
(
hasLib
pkginfo
)
then
empty
else
...
...
@@ -378,6 +384,9 @@ showPackageDetailedInfo pkginfo =
dispYesNo
True
=
text
"Yes"
dispYesNo
False
=
text
"No"
dispExtDep
(
SourceDependency
dep
)
=
disp
dep
dispExtDep
(
InstalledDependency
dep
)
=
disp
dep
isInstalled
=
not
(
null
(
installedVersions
pkginfo
))
hasExes
=
length
(
executables
pkginfo
)
>=
2
--TODO: exclude non-buildable exes
...
...
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