Commit e8e897e7 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

CPP around the build failure introduced by #4352.

parent ef3a6a4a
{-# 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment