Visitar URL original
Remove strict `compose` versions by sjakobi · Pull Request #745 · haskell/containers · GitHub
Skip to content

Remove strict compose versions - #745

Merged
sjakobi merged 1 commit into
haskell:masterfrom
sjakobi:fix-compose
Sep 11, 2020
Merged

sjakobi merged 1 commit into
haskell:masterfrom
sjakobi:fix-compose

Conversation

@sjakobi

@sjakobi sjakobi commented Sep 10, 2020

Copy link
Copy Markdown
Member

@sjakobi

sjakobi commented Sep 10, 2020

Copy link
Copy Markdown
Member Author

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

treeowl commented Sep 10, 2020 via email

Copy link
Copy Markdown
Contributor

@sjakobi

sjakobi commented Sep 10, 2020

Copy link
Copy Markdown
Member Author

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

treeowl commented Sep 11, 2020

Copy link
Copy Markdown
Contributor

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

@sjakobi

sjakobi commented Sep 11, 2020

Copy link
Copy Markdown
Member Author

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

sjakobi commented Sep 11, 2020

Copy link
Copy Markdown
Member Author

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

@treeowl

treeowl commented Sep 11, 2020 via email

Copy link
Copy Markdown
Contributor

@treeowl

treeowl commented Sep 11, 2020 via email

Copy link
Copy Markdown
Contributor

@sjakobi

sjakobi commented Sep 11, 2020

Copy link
Copy Markdown
Member Author

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

treeowl commented Sep 11, 2020 via email

Copy link
Copy Markdown
Contributor

@sjakobi

sjakobi commented Sep 11, 2020 •

Copy link
Copy Markdown
Member Author

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

treeowl commented Sep 11, 2020 via email

Copy link
Copy Markdown
Contributor

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