Skip to content

Move some Unfold and Stream step functions to Producer module#3232

Merged
harendra-kumar merged 8 commits into
masterfrom
unfold-producer-move
Jun 4, 2026
Merged

Move some Unfold and Stream step functions to Producer module#3232
harendra-kumar merged 8 commits into
masterfrom
unfold-producer-move

Conversation

@harendra-kumar
Copy link
Copy Markdown
Member

No description provided.

Eta-reducing step functions to arity 1 causes PAP allocations when
the stream is composed at runtime (iterated/dynamic pipelines), since
the step closure is then called through a dynamic function pointer
where GHC cannot inline away the partial applications.

Fix by making all arguments explicit on mapM, crossApply, crossApplySnd
and crossApplyFst step functions. Document the guideline.
@harendra-kumar harendra-kumar force-pushed the unfold-producer-move branch from 020455d to d7f6beb Compare June 4, 2026 17:47
@harendra-kumar harendra-kumar merged commit d7f6beb into master Jun 4, 2026
15 of 19 checks passed
@harendra-kumar harendra-kumar deleted the unfold-producer-move branch June 4, 2026 17:52
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.

1 participant