-
Notifications
You must be signed in to change notification settings - Fork 149
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
Patch maps better #328
Patch maps better #328
Conversation
* Use the `merge` API from `containers` to perform each merge in one go. * Use lazy merge operations for both; this is more consistent.
If we decide to include this, we can use it for `IntMap` too.
I did a fancy useless-deletion detection thing for |
data Changed a | ||
= Unchanged a | ||
| Changed a | ||
deriving (Functor) |
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.
Are there any speed benefits to making this newtype Changed a = Changed (ChangedTag, a)
? Or does that, as I imagine, compile down to the same thing?
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.
See my comment from a minute ago.
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.
Lazy pairs are kind of challenging to compile, so yeah, it's really between what @treeowl suggested and what's already written. (But I don't think this issue should block anything on this MR.)
data Changed a | ||
= Unchanged a | ||
| Changed a | ||
deriving (Functor) |
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.
Should I change this to data Changed a = Changed !Bool a
or similar? I'll have to look at Core to see if GHC will unbox it nicely in that case. Might be an improvement.
Haha, this kind of thing is exactly why I got you to make Data.Map.Merge in the first place, it's kind of funny that you'd also end up helping us replace our old awkward merges with it. :D |
Moved to reflex-frp/patch#3 |
Use the
containers
merge interface to improve efficiency.Make strictness consistent.