Data.IntSet bug

David Benbennick dbenbenn at
Sun Nov 11 01:58:49 EST 2007

I think I have a fix for this bug.  I'll use darcs to send a patch, as
soon as I'm done checking out the repo.  Here's the change that I
think fixes the problem:

 subsetCmp t1@(Bin p1 m1 l1 r1) t2@(Bin p2 m2 l2 r2)
   | shorter m1 m2  = GT
-  | shorter m2 m1  = subsetCmpLt
+  | shorter m2 m1  = case subsetCmpLt of
+                       GT -> GT
+                       _ -> LT
   | p1 == p2       = subsetCmpEq
   | otherwise      = GT  -- disjoint

I also intend to send a QuickCheck that catches this bug, and some
comments to the IntSet sourcecode.

More information about the Libraries mailing list