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

Prevent Lazy.uncons from allocating a thunk #559

Merged
merged 1 commit into from
Nov 25, 2022

Conversation

clyring
Copy link
Member

@clyring clyring commented Nov 23, 2022

...at least for the second component of its result. The thunk for the first component is a bit hairier because the readWord8OffAddr# is considered a side effect by GHC and hence can currently never go away unless it is used lazily.

See also #558.

...at least for the second component of its result.
The thunk for the first component is a bit hairier because
the readWord8OffAddr# is considered a side effect by GHC
and hence can currently never go away unless it is used lazily.

See also haskell#558.
@Bodigrim Bodigrim linked an issue Nov 24, 2022 that may be closed by this pull request
@Bodigrim Bodigrim added this to the 0.11.4.0 milestone Nov 24, 2022
@clyring clyring merged commit 6455e29 into haskell:master Nov 25, 2022
@clyring
Copy link
Member Author

clyring commented Nov 25, 2022

I should have mentioned: Lazy.Char8.uncons is defined in terms of Lazy.uncons and does not need an analogous change.

Bodigrim pushed a commit to Bodigrim/bytestring that referenced this pull request Nov 26, 2022
...at least for the second component of its result.
The thunk for the first component is a bit hairier because
the readWord8OffAddr# is considered a side effect by GHC
and hence can currently never go away unless it is used lazily.

See also haskell#558.
vdukhovni pushed a commit to vdukhovni/bytestring that referenced this pull request Dec 7, 2022
...at least for the second component of its result.
The thunk for the first component is a bit hairier because
the readWord8OffAddr# is considered a side effect by GHC
and hence can currently never go away unless it is used lazily.

See also haskell#558.
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.

Uncons should not produce thunks
3 participants