Skip to content

Add flipped concatMap operations#3123

Merged
harendra-kumar merged 2 commits intomasterfrom
logic-programming-1
Jul 30, 2025
Merged

Add flipped concatMap operations#3123
harendra-kumar merged 2 commits intomasterfrom
logic-programming-1

Conversation

@harendra-kumar
Copy link
Copy Markdown
Member

No description provided.

From more technical and longer to more accessible and shorter ones.
@harendra-kumar harendra-kumar requested a review from adithyaov July 26, 2025 15:49
yieldk a r = foldShared $ unShare (f a) `combine` go r
in foldStreamShared (adaptState st) yieldk single stp m

RENAME(bindWith,concatForWith)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can still use the word bind

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

concat = flip bind
So we can keep using the word bind

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, I think we should call it flatMap

-> StreamK m a
-> (a -> m (StreamK m b))
-> StreamK m b
concatForWithM combine s f = concatForWith combine s (concatEffect . f)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

bindWithM? bind is a good word to use.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

bind has no intuitive meaning for normal programmers.

@harendra-kumar harendra-kumar merged commit 042cb8f into master Jul 30, 2025
18 of 22 checks passed
@harendra-kumar harendra-kumar deleted the logic-programming-1 branch August 1, 2025 09:18
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