Skip to content

unordered-containers-0.2.20 fails to build with hashable < 1.4 #487

@RyanGlScott

Description

@RyanGlScott

unordered-containers-0.2.20 fails to build when using a version of hashable older than 1.4.*:

$ cabal build --constraint="hashable<1.4" -w ghc-9.2
Build profile: -w ghc-9.2.8 -O1
In order, the following will be built (use -v for more details):
 - unordered-containers-0.2.20 (lib) (first run)
Preprocessing library for unordered-containers-0.2.20..
Building library for unordered-containers-0.2.20..
[4 of 9] Compiling Data.HashMap.Internal.Debug ( Data/HashMap/Internal/Debug.hs, /home/ryanscott/Documents/Hacking/Haskell/unordered-containers-0.2.20/dist-newstyle/build/x86_64-linux/ghc-9.2.8/unordered-containers-0.2.20/build/Data/HashMap/Internal/Debug.o, /home/ryanscott/Documents/Hacking/Haskell/unordered-containers-0.2.20/dist-newstyle/build/x86_64-linux/ghc-9.2.8/unordered-containers-0.2.20/build/Data/HashMap/Internal/Debug.dyn_o )

Data/HashMap/Internal/Debug.hs:99:15-27: error:
    • Could not deduce (Eq k) arising from a use of ‘validInternal’
      from the context: Hashable k
        bound by the type signature for:
                   valid :: forall k v. Hashable k => HashMap k v -> Validity k
        at Data/HashMap/Internal/Debug.hs:97:1-48
      Possible fix:
        add (Eq k) to the context of
          the type signature for:
            valid :: forall k v. Hashable k => HashMap k v -> Validity k
    • In the expression: validInternal initialSubHashPath t
      In an equation for ‘valid’:
          valid t
            = validInternal initialSubHashPath t
            where
                validInternal p Empty = Invalid INV1_internal_Empty p
                validInternal p (Leaf h l) = validHash p h <> validLeaf p h l
                validInternal p (Collision h ary)
                  = validHash p h <> validCollision p h ary
                validInternal p (BitmapIndexed b ary) = validBitmapIndexed p b ary
                validInternal p (Full ary) = validFull p ary
                validHash p h
                  | hashMatchesSubHashPath p h = Valid
                  | otherwise = Invalid (INV6_misplaced_hash h) p
                validLeaf p h (L k _)
                  | hash k == h = Valid
                  | otherwise = Invalid (INV7_key_hash_mismatch k h) p
                validCollision p h ary
                  = validCollisionSize
                      <> A.foldMap (validLeaf p h) ary <> distinctKeys
                  where
                      n = A.length ary
                      validCollisionSize
                        | n < 2 = Invalid (INV9_Collision_size n) p
                        | otherwise = Valid
                      ....
                ....
   |
99 | valid t     = validInternal initialSubHashPath t
   |               ^^^^^^^^^^^^^
Error: cabal: Failed to build unordered-containers-0.2.20.

unordered-containers-0.2.19.1 does not have this issue, based on my local testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions