Skip to content

⭐️ [FEATURE]: Add tuple generic types #1

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
jkulvich opened this issue Oct 31, 2023 · 0 comments
Open

⭐️ [FEATURE]: Add tuple generic types #1

jkulvich opened this issue Oct 31, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jkulvich
Copy link
Contributor

Is your feature request related to a problem? Please describe.
It can be tedious to declare a new structure every time we need to transfer various related data between the conveyor elements.

Describe the solution you'd like
Now we need to declare a new structure to communicate between pipes, I suggest next:

type msgOneToTwo = pipe.Tuple2[string, int]
type msgTwoToThree = pipe.Tuple2[int, string]

msg1 := make(chan msgOneToTwo, 2>>8)

msg2 := pipe.Map(..., func(msg msgOneToTwo) msgTwoToThree {
  return pipe.T2(msg.B, msg.A)
}, msg1)

... := pipe.Map(..., msg2)

Describe alternatives you've considered
I found a convenient solution to this problem using the samber/lo. It would be good to introduce tuples into the current module.

Additional context
none

@jkulvich jkulvich added the enhancement New feature or request label Oct 31, 2023
@jkulvich jkulvich self-assigned this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant