mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
25 lines
797 B
Go
25 lines
797 B
Go
package io
|
|
|
|
import (
|
|
G "github.com/IBM/fp-go/io/generic"
|
|
T "github.com/IBM/fp-go/tuple"
|
|
)
|
|
|
|
// SequenceT converts n inputs of higher kinded types into a higher kinded types of n strongly typed values, represented as a tuple
|
|
|
|
func SequenceT1[A any](a IO[A]) IO[T.Tuple1[A]] {
|
|
return G.SequenceT1[IO[A], IO[T.Tuple1[A]]](a)
|
|
}
|
|
|
|
func SequenceT2[A, B any](a IO[A], b IO[B]) IO[T.Tuple2[A, B]] {
|
|
return G.SequenceT2[IO[A], IO[B], IO[T.Tuple2[A, B]]](a, b)
|
|
}
|
|
|
|
func SequenceT3[A, B, C any](a IO[A], b IO[B], c IO[C]) IO[T.Tuple3[A, B, C]] {
|
|
return G.SequenceT3[IO[A], IO[B], IO[C], IO[T.Tuple3[A, B, C]]](a, b, c)
|
|
}
|
|
|
|
func SequenceT4[A, B, C, D any](a IO[A], b IO[B], c IO[C], d IO[D]) IO[T.Tuple4[A, B, C, D]] {
|
|
return G.SequenceT4[IO[A], IO[B], IO[C], IO[D], IO[T.Tuple4[A, B, C, D]]](a, b, c, d)
|
|
}
|