[add sfilter methods to Util.BitSet
John Meacham <john@repetae.net>**20090219145520
 Ignore-this: 471e2d99b12ca16d9ea712914dc25f69
] hunk ./Util/BitSet.hs 54
-    toList (BitSet v) = f 0 where
-        f c | c >= 32 = []
-            | otherwise = if testBit v c then c:f (c + 1) else f (c + 1)
+    toList (BitSet w) = f w 0 where
+        f 0 _ = []
+        f w n = if even w then f (w `shiftR` 1) (n + 1) else n:f (w `shiftR` 1) (n + 1)
+    sfilter fn (BitSet w) = f w 0 0 where
+        f 0 _ r = BitSet r
+        f w n r = if even w || not (fn n) then f w1 n1 r else f w1 n1 (setBit r n) where
+            !n1 = n + 1
+            !w1 = w `shiftR` 1
hunk ./Util/BitSet.hs 81
+    sfilter fn (EnumBitSet s) = EnumBitSet $ sfilter (fn . toEnum) s
+