Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
e8e897e7
Commit
e8e897e7
authored
Feb 23, 2017
by
Mikhail Glushenkov
Browse files
CPP around the build failure introduced by #4352.
parent
ef3a6a4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Cabal/Distribution/Types/DependencyMap.hs
View file @
e8e897e7
{-# LANGUAGE CPP #-}
#
ifdef
MIN_VERSION_containers
#
if
MIN_VERSION_containers
(
0
,
5
,
0
)
#
define
MIN_VERSION_containers_0_5_0
#
endif
#
endif
#
ifndef
MIN_VERSION_containers
#
if
__GLASGOW_HASKELL__
>=
706
#
define
MIN_VERSION_containers_0_5_0
#
endif
#
endif
module
Distribution.Types.DependencyMap
(
DependencyMap
,
toDepMap
,
...
...
@@ -12,7 +26,11 @@ import Distribution.Types.Dependency
import
Distribution.Version
import
Distribution.Package
#
ifdef
MIN_VERSION_containers_0_5_0
import
qualified
Data.Map.Lazy
as
Map
#
else
import
qualified
Data.Map
as
Map
#
endif
-- | A map of dependencies. Newtyped since the default monoid instance is not
-- appropriate. The monoid instance uses 'intersectVersionRanges'.
...
...
@@ -43,8 +61,13 @@ constrainBy :: DependencyMap -- ^ Input map
->
DependencyMap
constrainBy
left
extra
=
DependencyMap
$
#
ifdef
MIN_VERSION_containers_0_5_0
Map
.
foldrWithKey
tightenConstraint
(
unDependencyMap
left
)
(
unDependencyMap
extra
)
#
else
Map
.
foldWithKey
tightenConstraint
(
unDependencyMap
left
)
(
unDependencyMap
extra
)
#
endif
where
tightenConstraint
n
c
l
=
case
Map
.
lookup
n
l
of
Nothing
->
l
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment