• Herbert Valerio Riedel's avatar
    Make `Version` type opaque (#3905) · bb2026c4
    Herbert Valerio Riedel authored
    Similiar to dabd9d98 which made
    `PackageName` opaque, this makes `Distribution.Version.Version` opaque.
    
    The most common version numbers occuring on Hackage are 3- and
    4-part versions. This results in significant Heap overhead due to
    `Data.Version`'s inefficient internal representation.
    
    So like the `PackageName` commit, this commit is a preparatory commit to
    pave the way for replacing `Version`'s internal representation by a
    representation with a memory footprint which can be an order of
    magnitude smaller.
    
    Finally, this also adds a new functor-like convenience function
    
        alterVersion :: ([Int] -> [Int]) -> Version -> Version
    
    for modifying the version number components.
    bb2026c4
Register.hs 23.5 KB