Skip to content

confusing documentation for notElemB #1

Open
joeyh opened this Issue Mar 11, 2012 · 0 comments

1 participant

@joeyh
joeyh commented Mar 11, 2012

I was reading this documentation, and spotted what seems to be a bug in it:

elemB :: a -> Bloom a -> BoolSource

Query an immutable Bloom filter for membership. If the value is present, return True. If the value is not present, there is still some possibility that True will be returned.

notElemB :: a -> Bloom a -> BoolSource

Query an immutable Bloom filter for non-membership. If the value is present, return False. If the value is not present, there is still some possibility that True will be returned.

-- The bug is the last "True" above, which was probably copied and pasted from the description of elemB and you forgot to change to False.

At least, I think that, If the value is not present, there is a low probability of False still being returned, while a high probabilty of True being returned. My reasoning: Bloom filters have a low probability of a false positive. A false positive in notElemB means that it thinks an item is present while it's not, so it should return False in this low probabilty case. Another way to think about it is that notElemB is equivilant to (not . elemB), except possibly does less work (due to using any vs all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.