Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This is an internal module. End-users should not use it.
Synopsis
- aggregateResults :: Aggregator -> [Result] -> ([AggregatedResult], [LogEntry])
- type Aggregator = NonEmpty Version -> VersionRange
- data VersionRange
- showVersionRange :: VersionRange -> String
- aggOr :: Aggregator
- aggPvpMajor :: Aggregator
- aggPvpMinor :: Aggregator
- groupAllPreservingOrderBy :: (a -> a -> Bool) -> [a] -> [NonEmpty a]
- aggregatePackageVersions :: Aggregator -> NonEmpty (String, [(PackageName, Maybe Version)]) -> (Maybe [(PackageName, Maybe VersionRange)], [LogEntry])
Top-level function
aggregateResults :: Aggregator -> [Result] -> ([AggregatedResult], [LogEntry]) Source #
Aggregate Result
s with the given Aggregator
. It first groups
Result
s based on its resultFor
field, and then each group is
aggregated into an AggregatedResult
.
If it fails, it returns an empty list of AggregatedResult
. It
also returns a list of LogEntry
s to report warnings and errors.
Aggregators
type Aggregator = NonEmpty Version -> VersionRange Source #
Aggregate some Version
s into a VersionRange
.
data VersionRange #
Instances
showVersionRange :: VersionRange -> String Source #
Let Cabal convert VersionRange
to String
aggOr :: Aggregator Source #
Aggregator of ORed versions.
aggPvpMajor :: Aggregator Source #
Aggregate versions to the range that the versions cover in a PVP sense. This aggregator sets the upper bound to a major version, which means it assumes major-version bump is not backward-compatible.
aggPvpMinor :: Aggregator Source #
Aggregate versions to the range that versions cover in a PVP sense. This aggregator sets the upper bound to a minor version, which means it assumes minor-version bump is not backward-compatible.
Utility
Low-level functions
aggregatePackageVersions Source #
:: Aggregator | |
-> NonEmpty (String, [(PackageName, Maybe Version)]) | ( |
-> (Maybe [(PackageName, Maybe VersionRange)], [LogEntry]) |
Aggregate one or more maps between PackageName
and Version
.
The input Maybe
Version
s should all be Just
. Nothing
version
is warned and ignored. If the input versions are all Nothing
, the
result version range is Nothing
.
The PackageName
lists in the input must be consistent (i.e. they
all must be the same list.) If not, it returns Nothing
map and an
error is logged.