Commit ab76b5c1 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add and export simplifyDependency

Just uses simplifyVersionRange on the version range in the dep
parent 007ad5c7
......@@ -51,6 +51,7 @@ module Distribution.Package (
Dependency(..),
thisPackageVersion,
notThisPackageVersion,
simplifyDependency,
-- * Package classes
Package(..), packageName, packageVersion,
......@@ -58,7 +59,8 @@ module Distribution.Package (
) where
import Distribution.Version
( Version(..), VersionRange, anyVersion, thisVersion, notThisVersion )
( Version(..), VersionRange, anyVersion, thisVersion
, notThisVersion, simplifyVersionRange )
import Distribution.Text (Text(..))
import qualified Distribution.Compat.ReadP as Parse
......@@ -129,6 +131,13 @@ notThisPackageVersion :: PackageIdentifier -> Dependency
notThisPackageVersion (PackageIdentifier n v) =
Dependency n (notThisVersion v)
-- | Simplify the 'VersionRange' expression in a 'Dependency'.
-- See 'simplifyVersionRange'.
--
simplifyDependency :: Dependency -> Dependency
simplifyDependency (Dependency name range) =
Dependency name (simplifyVersionRange range)
-- | Class of things that can be identified by a 'PackageIdentifier'
--
-- Types in this class are all notions of a package. This allows us to have
......
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