Skip to content

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

Description

@jkulvich

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

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions