Skip to content

fix(Record): make fromIterableBy dual for pipe-friendly usage#6212

Open
lihan3238 wants to merge 1 commit intoEffect-TS:mainfrom
lihan3238:fix/record-fromiterableby-dual
Open

fix(Record): make fromIterableBy dual for pipe-friendly usage#6212
lihan3238 wants to merge 1 commit intoEffect-TS:mainfrom
lihan3238:fix/record-fromiterableby-dual

Conversation

@lihan3238
Copy link
Copy Markdown

Summary

Wraps Record.fromIterableBy with dual(2, ...) so it supports both data-first and data-last (curried) calling conventions, consistent with fromIterableWith and other dual APIs in the codebase.

This enables the following pipe-friendly usage:

pipe(rows, Record.fromIterableBy(Struct.get("authEmail")))

Closes #6092

Test plan

  • Verify data-first usage still works: Record.fromIterableBy(items, fn)
  • Verify data-last/curried usage works: pipe(items, Record.fromIterableBy(fn))
  • Verify type inference is correct in both modes

Wraps `Record.fromIterableBy` with `dual(2, ...)` so it supports both
data-first and data-last (curried) calling conventions, consistent with
`fromIterableWith` and other dual APIs in the codebase.

Closes Effect-TS#6092
@lihan3238 lihan3238 requested a review from mikearnaldi as a code owner May 5, 2026 15:34
@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog May 5, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

⚠️ No Changeset found

Latest commit: 93efe97

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

Record.fromIterableBy is not dual/curried (awkward in pipe)

1 participant