Skip to content
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

Remove strict compose versions #745

Merged
merged 1 commit into from
Sep 11, 2020
Merged

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented Sep 10, 2020

@sjakobi
Copy link
Member Author

sjakobi commented Sep 10, 2020

Once this is merged, I think it would be good to make a release in time for GHC 9.0, so users of compose are less likely to encounter the differences in strictness.

@treeowl
Copy link
Contributor

treeowl commented Sep 10, 2020 via email

@sjakobi
Copy link
Member Author

sjakobi commented Sep 10, 2020

Do you know the deadline?

Unfortunately I don't. https://gitlab.haskell.org/ghc/ghc/-/issues/18216#note_298165 seems to indicate that the release preparations are ongoing.

@bgamari When would a containers release need to happen so it could be included in GHC 9.0.1?

@sjakobi sjakobi requested a review from treeowl September 11, 2020 21:33
@sjakobi sjakobi merged commit ddd24d9 into haskell:master Sep 11, 2020
@sjakobi sjakobi deleted the fix-compose branch September 11, 2020 21:39
@treeowl
Copy link
Contributor

treeowl commented Sep 11, 2020

Do we have enough map/mapMaybe fusion rules to make the old behavior cheap to recover?

@sjakobi
Copy link
Member Author

sjakobi commented Sep 11, 2020

Do we have enough map/mapMaybe fusion rules to make the old behavior cheap to recover?

No idea.

I was wondering how to best convert a lazy map to a strict one by forcing all the values. Is there anything better than *.Strict.map id?

@sjakobi
Copy link
Member Author

sjakobi commented Sep 11, 2020

Let's not discuss this in a closed PR though.

@treeowl
Copy link
Contributor

treeowl commented Sep 11, 2020 via email

@treeowl
Copy link
Contributor

treeowl commented Sep 11, 2020 via email

@sjakobi
Copy link
Member Author

sjakobi commented Sep 11, 2020

Actually, that's wrong.... The nf package has the right stuff for doing it
efficiently. Or a strictifying fold.

What does that look like in practice? Could you give an example?

@treeowl
Copy link
Contributor

treeowl commented Sep 11, 2020 via email

@sjakobi
Copy link
Member Author

sjakobi commented Sep 11, 2020

So a toStrict function could be defined as

toStrict :: Map k v -> Map k v
toStrict m = foldl' (flip seq) () m `seq` m

Cheers!

@treeowl
Copy link
Contributor

treeowl commented Sep 11, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants