-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'elem' is O(n) for sets :( #56
Comments
@neongreen this is probably meant for the less handsome (but better at Haskell!) David Feuer @treeowl |
@dfeuer yep, I noticed my mistake and edited the message soon after posting it. |
@neongreen Unfortunately, this is not possible for |
Sets usually have O(log n)
elem
, but IntSet and HashSet have O(n)elem
because theelem
fromFoldable
is slower than it could be (since it can't use theHashable
orOrd
constraints). Facepalm.We can fix it by doing something like this, as David Feuer proposed at [email protected]:
(But for
NontrivialContainer
instead ofFoldable
.)The text was updated successfully, but these errors were encountered: