Git Product home page Git Product logo

Comments (4)

meooow25 avatar meooow25 commented on August 29, 2024

This is a bug in isProperSubmapOfBy.

BAL -> submapCmp predicate t1 l2
BAR -> submapCmp predicate t1 r2

When the first tree is in the left/right child of the second tree, and the first tree and the left/right child compare equal, the EQ should be updated to LT since it's a proper submap.

I tried to trace the source of the error and looks like it has been there since the commit which introduced IntMap bbbba97.

from containers.

jwaldmann avatar jwaldmann commented on August 29, 2024

whoa, indeed.

when translating the textual description to a property, with leancheck I get

ghci> checkFor 100000 $ \ f a b -> I.isProperSubmapOfBy f a b == (S.isProperSubsetOf  (I.keysSet a ) (I.keysSet b) && and (I.intersectionWith f a b))
*** Failed! Falsifiable (after 4652 tests):
(\_ _ -> True) (fromList [(0,()),(1,())]) (fromList [(-1,()),(0,()),(1,())])

Also,

ghci> I.isProperSubmapOf (I.fromList [(0,()),(1,())]) (I.fromList [(-1,()),(0,()),(1,())])
False


from containers.

meooow25 avatar meooow25 commented on August 29, 2024

This bug was fixed for IntSet in 71fe15f GHC #1762. Unfortunately they missed IntMap.

from containers.

treeowl avatar treeowl commented on August 29, 2024

That's an incredibly old bug. Wow.

from containers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.