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
fec3730b
Unverified
Commit
fec3730b
authored
4 years ago
by
Oleg Grenrus
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7037 from phadej/simpler-prettyVersionRange
Simpler prettyVersionRange
parents
3695dab6
310d3461
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/src/Distribution/Types/VersionRange/Internal.hs
+15
-15
15 additions, 15 deletions
Cabal/src/Distribution/Types/VersionRange/Internal.hs
with
15 additions
and
15 deletions
Cabal/src/Distribution/Types/VersionRange/Internal.hs
+
15
−
15
View file @
fec3730b
...
...
@@ -247,22 +247,22 @@ instance Pretty VersionRange where
|
otherwise
=
prettyVersionRange16
prettyVersionRange
::
VersionRange
->
Disp
.
Doc
prettyVersionRange
=
fst
.
cataVersionRange
alg
prettyVersionRange
vr
=
cataVersionRange
alg
vr
0
where
alg
::
VersionRangeF
(
Disp
.
Doc
,
Int
)
->
(
Disp
.
Doc
,
Int
)
alg
(
ThisVersionF
v
)
=
(
Disp
.
text
"=="
<<>>
pretty
v
,
0
)
alg
(
LaterVersionF
v
)
=
(
Disp
.
char
'>'
<<>>
pretty
v
,
0
)
alg
(
OrLaterVersionF
v
)
=
(
Disp
.
text
">="
<<>>
pretty
v
,
0
)
alg
(
EarlierVersionF
v
)
=
(
Disp
.
char
'<'
<<>>
pretty
v
,
0
)
alg
(
OrEarlierVersionF
v
)
=
(
Disp
.
text
"<="
<<>>
pretty
v
,
0
)
alg
(
MajorBoundVersionF
v
)
=
(
Disp
.
text
"^>="
<<>>
pretty
v
,
0
)
alg
(
UnionVersionRangesF
(
r1
,
p1
)
(
r2
,
p2
))
=
(
punct
1
p
1
r
1
<+>
Disp
.
text
"||"
<+>
punct
2
p2
r2
,
2
)
alg
(
IntersectVersionRangesF
(
r1
,
p1
)
(
r2
,
p2
))
=
(
punct
0
p1
r1
<+>
Disp
.
text
"&&"
<+>
punct
1
p2
r2
,
1
)
p
unct
p
p'
|
p
<
p'
=
Disp
.
parens
|
otherwi
se
=
id
alg
::
VersionRangeF
(
Int
->
Disp
.
Doc
)
->
Int
->
Disp
.
Doc
alg
(
ThisVersionF
v
)
_
=
Disp
.
text
"=="
<<>>
pretty
v
alg
(
LaterVersionF
v
)
_
=
Disp
.
text
">"
<<>>
pretty
v
alg
(
OrLaterVersionF
v
)
_
=
Disp
.
text
">="
<<>>
pretty
v
alg
(
EarlierVersionF
v
)
_
=
Disp
.
text
"<"
<<>>
pretty
v
alg
(
OrEarlierVersionF
v
)
_
=
Disp
.
text
"<="
<<>>
pretty
v
alg
(
MajorBoundVersionF
v
)
_
=
Disp
.
text
"^>="
<<>>
pretty
v
alg
(
UnionVersionRangesF
r1
r2
)
d
=
parens
(
d
>
0
)
$
r
1
1
<+>
Disp
.
text
"||"
<+>
r2
0
alg
(
IntersectVersionRangesF
r1
r2
)
d
=
parens
(
d
>
1
)
$
r1
2
<+>
Disp
.
text
"&&"
<+>
r2
1
p
arens
True
=
Disp
.
parens
parens
Fal
se
=
id
-- | Don't use && and || operators. If possible.
prettyVersionRange16
::
VersionRange
->
Disp
.
Doc
...
...
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