-
Notifications
You must be signed in to change notification settings - Fork 13
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
Strict maps #102
base: master
Are you sure you want to change the base?
Strict maps #102
Conversation
Closes lspitzner#60
Why no Also, do we want strict |
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.
I don't know how many more functions to add. Do we want to do a whole Strict
module like containers
?
One option would be |
For adjusting the minimum, we can't do better than adjustMinWithKey' f = getSolo . adjustMinWithKey ((Solo $!) . f) Doing it "manually" with the constructors produces exactly the same Core, unfolding, inlining guidance, etc. So arguably we don't need |
I just realized I don't understand your last sentence. Implementing |
That might be a good idea, given the amount of strict functions. I agree that such a module should only export the strict functions. I'm also used to the strict version just having a
Yeah, we definitely shouldn't expect everyone to know that you can use
For those I'd say let the user force the elements. |
I'll ask around and see what people think. If we go with a separate module, strict insertion wouldn't be a big deal to include. Even strict extraction could make sense in that context—I wish minViewWithKey q >>= \((k, v :: Int), q') ->
Just (... [v + 1]) will produce a thunk to calculate minViewWithKey' q = case minViewWithKey q of
r@(Just ((_, !_), _)) -> r
Nothing -> Nothing this will not. minViewWithKey' q >>= \((k, v :: Int), q') ->
Just (... [v + 1]) |
I opened a discussion on Discourse: https://discourse.haskell.org/t/organization-of-strict-functions/6354. |
Closes #60