Skip to content

+ Operators for map2 and map3 #624

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

+ Operators for map2 and map3 #624

wants to merge 1 commit into from

Conversation

gusty
Copy link
Member

@gusty gusty commented Jun 6, 2025

  • In F# we have ||> which takes a tuple on the left side and applies each argument to a function on the right side
  • In F#+ we have |>> which takes a value inside a functor and maps with a function on the right side

Therefore it would make sense to have:

  • ||>> which takes a tuple with two functors and maps with a function on the right side. The is zip and map or simply map2.

Then it makes sense to add |||>> and the less idiomatic flipped versions <<|| and <<|||.

In the wild I've seen already cases where we have pipes with |>> and in the middle the need to switch to applicative (<!>, <*>) style, which breaks a bit the nice piping, In most of those cases these operators will be a good solution.

Open question about ||>>> and |||>>>.

@gusty
Copy link
Member Author

gusty commented Jun 8, 2025

Before merging this, we need to decide how it will deal with the different Applicatives (Parallel vs Sequential).

We could add stuff like ||--> for lift2 (monad derived applicatives).

Any better ideas?

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