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

feat: Add flatten operator. #937

Merged
merged 1 commit into from
Jan 14, 2024
Merged

feat: Add flatten operator. #937

merged 1 commit into from
Jan 14, 2024

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Jan 13, 2024

Motivation:

  1. Add a flatten operator which can simplify the code for common usage.
  2. flatten is well known for most scala developers
  3. both ZIO and FS2 have flatten operator.

refs: #936

Cons:

  • lack javadsl support
  • one more operator.

Result:
Simpler code.

(for {
i <- Source(1 to 5)
j = Source(1 to i)
} yield j).flatten
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use flatten instead of flatMapConcat(identity)

Copy link
Contributor

@nvollmar nvollmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - now that #941 is merged

@pjfanning pjfanning added the release notes Need to release note label Jan 14, 2024
@He-Pin He-Pin merged commit 447728f into apache:main Jan 14, 2024
18 checks passed
@He-Pin He-Pin deleted the flatten branch January 14, 2024 12:24
@He-Pin He-Pin restored the flatten branch January 25, 2024 17:50
@He-Pin He-Pin deleted the flatten branch January 25, 2024 17:52
@pjfanning pjfanning removed the release notes Need to release note label Aug 14, 2024
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.

3 participants