-
Notifications
You must be signed in to change notification settings - Fork 13
Pattern synonyms and Data instances #92
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
Conversation
@konsumlamm I suspect we'll want similar pattern synonyms for max-queues, but do we want (:>) :: Ord a => MaxQueue a -> a -> MaxQueue a or (<:) :: Ord a => a -> MaxQueue a -> MaxQueue a I think the first option is clearer, since I think of the maximum as coming after the rest. But ergonomics will then be quite different between min-queues and max-queues, and I'm not sure how good that is. Hmmmmm.... Semi-separately: now that the |
* Add some pattern synonyms. * Improve the `Data` instances to - Make the `MinPQueue` version incremental, like the `MinQueue` one. - Make all the instances respect the queue invariants. * Use the pattern synonyms to explain the `Data` instances. Fixes lspitzner#50.
2c2df9a
to
3496264
Compare
@konsumlamm In case you didn't notice, I was hoping for a review of this. |
I did notice, don't worry. It just takes some time to get into the issue again and I still have other things to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I don't know much about Data
, so I'm just looking if things feel right.
I'm reluctant about the pattern synonyms, as they're not O(1) (while standard patterns are) and people might expect them to be, unknowingly introducing a slowdown. Is there a problem with keeping the |
Btw, if you have time, could you take a look if #55 can be closed? |
I definitely like pattern synonyms for things that are at worst polylogarithmic. I think that's fine; I can document the bounds explicitly. I will update the PR to deal with the other issues you pointed out. |
@konsumlamm I think I've addressed all the issues. I would like to squash the commits rather than merging them intact. |
I really don't like the inconsistency between the way the plain versions and |
Hmm, ok. As for your question about Do you also want to improve the |
I don't want to make any decisions whatsoever about max queues in this PR. I'll open a new one for pattern synonyms for them. |
That's what I always do anyway. |
Co-authored-by: konsumlamm <[email protected]>
Are you ready to approve? |
Data
instances toMinPQueue
version incremental, like theMinQueue
one.Data
instances.Fixes #50.