-
Notifications
You must be signed in to change notification settings - Fork 181
I think we need a strictness audit #231
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
Comments
This was done in #1019. Well, not exactly—the tests checks that any attempt to insert a bottom value results in a bottom map, which is equivalent and easier to test.
I suppose we could do this if we put an |
What I meant had nothing to do with |
Oh I see what you mean. I definitely agree that a newtype would have been a good idea to avoid this pitfall. And it would still allow the user to explicitly change from strict to lazy in constant time (or vice versa unsafely) if they want. I expect this will break a lot of stuff if we were to try this today. I don't know if that's worth it. |
Adding modules to use such a newtype wouldn't break anything. |
So we add, say, |
Not by that name, certainly! |
FWIW I would be very happy if we introduced a guaranteed strict newtype. Accidentally using functions from It would be interesting to know how much code would actually break if we just changed the meaning of the current modules. |
I've created #1124, we can continue the discussion there. |
The invariant I'd like to maintain is that any value in a structure produced by an exposed function in
Data.{Map,IntMap}.Strict
that was not present in a map passed to that function should be in WHNF. I'd also like to consider "really strict" versions of these types, presumably in separate modules. If we can make them perform well, these could be genuine strict datatypes. If not, we can usenewtype
to hide away the inner laziness.The text was updated successfully, but these errors were encountered: