Skip to content

API Distribution.Types.VersionInterval dropped intersectVersionIntervals etc. in 3.6 #7916

Open
@andreasabel

Description

@andreasabel

Background: I am looking to implement a check whether some version constraint subsumes another one, for hackage-trustees/hackage-cli#28. We know that a subsumes b can e.g. be implemented as (a intersect b) = b.

I notice that up to 3.4, there was intersectVersionIntervals, and I traced this back to 2.4 (maybe even older).
In 3.6 this function is gone, apparently due to a rewrite:

-- | In @Cabal-3.6@ this module have been rewritten.
--
--
module Distribution.Types.VersionInterval (

It seems that the whole module Distribution.Types.VersionInterval was moved to Distribution.Types.VersionInterval.Legacy and the former module was reimplemented from scratch, but supplying only parts of the former API. The legacy module is announced to be deleted in 3.8.

I propose to restore the deleted functionality to Distribution.Types.VersionInterval, at least the mathematically essential functions. Basically, all the algebraic operations present for the "syntactic" form VersionRange should be implemented for the "semantic" form VersionIntervals as well; both are Boolean algebras.

(For my use in hackage-cli that would mean I could now support 2.4, then upgrade to 3.4, then to 3.8---needing to skip 3.6.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions