Conversation
* Remove unnecessary constraints from `Data.BitSet.Generic`. * Use a more streamlined implementation of `foldl'` and `foldr'` when possible. * Update Cabal file to indicate required extensions. * Make the tests work again.
Make `fromList` fuse with `build` and `augment`, and make `toList` fuse with `foldr`. Express the `toList/fromList` rule in terms of rewrite helper targets; this has the pleasant side effect of letting it handle things like `fromList $ toList xs ++ toList ys`. Adjust arities of functions in `Data.BitSet.Word` to convince most of the underlying functions to inline. I *think* this is what we want.
| -- | /O(1)/. Delete an item from the bit set. | ||
| delete :: Enum a => a -> BitSet a -> BitSet a | ||
| delete = GS.delete | ||
| delete x xs = GS.delete x xs |
There was a problem hiding this comment.
Hmm, could you explain why the arguments are necessary here?
There was a problem hiding this comment.
Look at the generated core with -O2. All will be fine if WS.delete is fully
applied and inlines, but if it's partially applied and passed to a
higher-order function that doesn't inline, the Bits dictionary may be
passed at runtime (I believe). The extra parameters there are to fully
apply GS.delete in WS.delete, so GHC will inline it when compiling
WS.delete.
On Jun 15, 2016 2:45 PM, "Sergei Lebedev" notifications@github.com wrote:
In src/Data/BitSet/Word.hs
#22 (comment):@@ -124,7 +124,7 @@ insert = GS.insert
-- | /O(1)/. Delete an item from the bit set.
delete :: Enum a => a -> BitSet a -> BitSet a
-delete = GS.delete
+delete x xs = GS.delete x xsHmm, could you explain why the arguments are necessary here?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/lambda-llama/bitset/pull/22/files/231962e0e6a63fe63e1952826f97ca529f20a4e5#r67221750,
or mute the thread
https://github.com/notifications/unsubscribe/ABzi_QRX_uV6tfFowIlj45kg27ygZu9Cks5qMEg4gaJpZM4IyfKO
.
If the "general improvements" PR is merged, I'll rebase this.