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
3a1f1f24
Commit
3a1f1f24
authored
10 years ago
by
Edsko de Vries
Browse files
Options
Downloads
Patches
Plain Diff
Make PP (PackagePath) structured type
parent
6b7fe108
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/Modular/Builder.hs
+1
-1
1 addition, 1 deletion
...install/Distribution/Client/Dependency/Modular/Builder.hs
cabal-install/Distribution/Client/Dependency/Modular/Package.hs
+12
-7
12 additions, 7 deletions
...install/Distribution/Client/Dependency/Modular/Package.hs
with
13 additions
and
8 deletions
cabal-install/Distribution/Client/Dependency/Modular/Builder.hs
+
1
−
1
View file @
3a1f1f24
...
...
@@ -154,4 +154,4 @@ buildTree idx ind igs =
Goals
)
where
qpns
|
ind
=
makeIndependent
igs
|
otherwise
=
L
.
map
(
Q
[]
)
igs
|
otherwise
=
L
.
map
(
Q
None
)
igs
This diff is collapsed.
Click to expand it.
cabal-install/Distribution/Client/Dependency/Modular/Package.hs
+
12
−
7
View file @
3a1f1f24
...
...
@@ -66,13 +66,17 @@ instI :: I -> Bool
instI
(
I
_
(
Inst
_
))
=
True
instI
_
=
False
-- | Package path. (Stored in "reverse" order.)
type
PP
=
[
PN
]
-- | Package path.
data
PP
=
Independent
Int
PP
|
Setup
PN
PP
|
None
deriving
(
Eq
,
Ord
,
Show
)
-- | String representation of a package path.
--
-- NOTE: This always ends in a period
showPP
::
PP
->
String
showPP
=
intercalate
"."
.
L
.
map
display
.
reverse
showPP
(
Independent
i
pp
)
=
show
i
++
"."
++
showPP
pp
showPP
(
Setup
pn
pp
)
=
display
pn
++
".setup."
++
showPP
pp
showPP
None
=
""
-- | A qualified entity. Pairs a package path with the entity.
data
Q
a
=
Q
PP
a
...
...
@@ -80,8 +84,8 @@ data Q a = Q PP a
-- | Standard string representation of a qualified entity.
showQ
::
(
a
->
String
)
->
(
Q
a
->
String
)
showQ
showa
(
Q
[]
x
)
=
showa
x
showQ
showa
(
Q
pp
x
)
=
showPP
pp
++
"."
++
showa
x
showQ
showa
(
Q
None
x
)
=
showa
x
showQ
showa
(
Q
pp
x
)
=
showPP
pp
++
showa
x
-- | Qualified package name.
type
QPN
=
Q
PN
...
...
@@ -94,7 +98,8 @@ showQPN = showQ display
-- them all independent.
makeIndependent
::
[
PN
]
->
[
QPN
]
makeIndependent
ps
=
[
Q
pp
pn
|
(
pn
,
i
)
<-
zip
ps
[
0
::
Int
..
]
,
let
pp
=
[
PackageName
(
show
i
)]
]
,
let
pp
=
Independent
i
None
]
unQualify
::
Q
a
->
a
...
...
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