1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-07-17 01:32:23 +02:00

fix: get rid of more IO

This commit is contained in:
Dr. Carsten Leue
2025-03-05 00:04:52 +01:00
parent e20679d73c
commit e7e58c9d54
11 changed files with 660 additions and 1378 deletions

View File

@ -39,15 +39,15 @@ func genericIOEither(param string) string {
var extrasIOEither = A.From("E") var extrasIOEither = A.From("E")
func generateIOEitherSequenceT(f, fg *os.File, i int) { func generateIOEitherSequenceT(f, fg *os.File, i int) {
deprecatedGenerateGenericSequenceT(nonGenericIOEither, genericIOEither, extrasIOEither)(f, fg, i) generateGenericSequenceT(nonGenericIOEither, extrasIOEither)(f, i)
} }
func generateIOEitherSequenceTuple(f, fg *os.File, i int) { func generateIOEitherSequenceTuple(f, fg *os.File, i int) {
deprecatedGenerateGenericSequenceTuple(nonGenericIOEither, genericIOEither, extrasIOEither)(f, fg, i) generateGenericSequenceTuple(nonGenericIOEither, extrasIOEither)(f, i)
} }
func generateIOEitherTraverseTuple(f, fg *os.File, i int) { func generateIOEitherTraverseTuple(f, fg *os.File, i int) {
deprecatedGenerateGenericTraverseTuple(nonGenericIOEither, genericIOEither, extrasIOEither)(f, fg, i) generateGenericTraverseTuple(nonGenericIOEither, extrasIOEither)(f, i)
} }
func generateIOEitherUneitherize(f, fg *os.File, i int) { func generateIOEitherUneitherize(f, fg *os.File, i int) {
@ -224,7 +224,8 @@ func generateIOEitherHelpers(filename string, count int) error {
fmt.Fprintf(f, ` fmt.Fprintf(f, `
import ( import (
G "github.com/IBM/fp-go/v2/%s/generic" G "github.com/IBM/fp-go/v2/%s/generic"
T "github.com/IBM/fp-go/v2/tuple" "github.com/IBM/fp-go/v2/internal/apply"
"github.com/IBM/fp-go/v2/tuple"
) )
`, pkg) `, pkg)
@ -238,8 +239,6 @@ import (
fmt.Fprintf(fg, ` fmt.Fprintf(fg, `
import ( import (
ET "github.com/IBM/fp-go/v2/either" ET "github.com/IBM/fp-go/v2/either"
T "github.com/IBM/fp-go/v2/tuple"
A "github.com/IBM/fp-go/v2/internal/apply"
) )
`) `)

View File

@ -306,11 +306,11 @@ func generateGenericSequenceT(
} }
fmt.Fprintf(f, ") %s {\n", nonGenericType(tuple)) fmt.Fprintf(f, ") %s {\n", nonGenericType(tuple))
fmt.Fprintf(f, " return apply.SequenceT%d(\n", i) fmt.Fprintf(f, " return apply.SequenceT%d(\n", i)
fmt.Fprintf(f, " Map[%s, %s],\n", "T1", generateNestedCallbacksPlain(1, i)) fmt.Fprintf(f, " Map[%s],\n", joinAll(", ")(extra, A.From("T1", generateNestedCallbacksPlain(1, i))))
// the apply calls // the apply calls
for j := 2; j <= i; j++ { for j := 2; j <= i; j++ {
fmt.Fprintf(f, " Ap[%s, T%d],\n", generateNestedCallbacksPlain(j, i), j) fmt.Fprintf(f, " Ap[%s],\n", joinAll(", ")(A.Of(generateNestedCallbacksPlain(j, i)), extra, A.Of(fmt.Sprintf("T%d", j))))
} }
// function parameters // function parameters
for j := 1; j <= i; j++ { for j := 1; j <= i; j++ {
@ -345,11 +345,11 @@ func generateGenericSequenceTuple(
} }
fmt.Fprintf(f, "]) %s {\n", nonGenericType(tuple)) fmt.Fprintf(f, "]) %s {\n", nonGenericType(tuple))
fmt.Fprintf(f, " return apply.SequenceTuple%d(\n", i) fmt.Fprintf(f, " return apply.SequenceTuple%d(\n", i)
fmt.Fprintf(f, " Map[%s, %s],\n", "T1", generateNestedCallbacksPlain(1, i)) fmt.Fprintf(f, " Map[%s],\n", joinAll(", ")(extra, A.From("T1", generateNestedCallbacksPlain(1, i))))
// the apply calls // the apply calls
for j := 2; j <= i; j++ { for j := 2; j <= i; j++ {
fmt.Fprintf(f, " Ap[%s, T%d],\n", generateNestedCallbacksPlain(j, i), j) fmt.Fprintf(f, " Ap[%s],\n", joinAll(", ")(A.Of(generateNestedCallbacksPlain(j, i)), extra, A.Of(fmt.Sprintf("T%d", j))))
} }
// function parameters // function parameters
@ -383,18 +383,18 @@ func generateGenericTraverseTuple(
return fmt.Sprintf("f%d F%d", j+1, j+1) return fmt.Sprintf("f%d F%d", j+1, j+1)
}) })
// return type // return type
paramType := fmt.Sprintf("tuple.Tuple%d[%s]", i, joinAll(", ")(extra, typesA)) paramType := fmt.Sprintf("tuple.Tuple%d[%s]", i, joinAll(", ")(typesA))
returnType := nonGenericType(fmt.Sprintf("tuple.Tuple%d[%s]", i, joinAll(", ")(extra, typesT))) returnType := nonGenericType(fmt.Sprintf("tuple.Tuple%d[%s]", i, joinAll(", ")(typesT)))
// non generic version // non generic version
fmt.Fprintf(f, "\n// TraverseTuple%d converts a [%s] into a [%s]\n", i, paramType, returnType) fmt.Fprintf(f, "\n// TraverseTuple%d converts a [%s] into a [%s]\n", i, paramType, returnType)
fmt.Fprintf(f, "func TraverseTuple%d[%s any](%s) func(%s) %s {\n", i, joinAll(", ")(extra, typesF, typesT, typesA), joinAll(", ")(paramF), paramType, returnType) fmt.Fprintf(f, "func TraverseTuple%d[%s any](%s) func(%s) %s {\n", i, joinAll(", ")(extra, typesF, typesT, typesA), joinAll(", ")(paramF), paramType, returnType)
fmt.Fprintf(f, " return func(t %s) %s {\n", paramType, returnType) fmt.Fprintf(f, " return func(t %s) %s {\n", paramType, returnType)
fmt.Fprintf(f, " return apply.TraverseTuple%d(\n", i) fmt.Fprintf(f, " return apply.TraverseTuple%d(\n", i)
fmt.Fprintf(f, " Map[%s, %s],\n", "T1", generateNestedCallbacksPlain(1, i)) fmt.Fprintf(f, " Map[%s],\n", joinAll(", ")(extra, A.From("T1", generateNestedCallbacksPlain(1, i))))
// the apply calls // the apply calls
for j := 2; j <= i; j++ { for j := 2; j <= i; j++ {
fmt.Fprintf(f, " Ap[%s, T%d],\n", generateNestedCallbacksPlain(j, i), j) fmt.Fprintf(f, " Ap[%s],\n", joinAll(", ")(A.Of(generateNestedCallbacksPlain(j, i)), extra, A.Of(fmt.Sprintf("T%d", j))))
} }
// the function parameters // the function parameters
for j := 1; j <= i; j++ { for j := 1; j <= i; j++ {

View File

@ -1,6 +1,6 @@
// Code generated by go generate; DO NOT EDIT. // Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at // This file was generated by robots at
// 2025-03-04 23:25:32.6587952 +0100 CET m=+0.002669801 // 2025-03-05 00:00:52.4586817 +0100 CET m=+0.002590501
package io package io

View File

@ -1,12 +1,14 @@
// Code generated by go generate; DO NOT EDIT. // Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at // This file was generated by robots at
// 2024-02-29 16:19:13.144922 +0100 CET m=+0.065757301 // 2025-03-04 23:59:33.8343102 +0100 CET m=+0.003180601
package ioeither package ioeither
import ( import (
G "github.com/IBM/fp-go/v2/ioeither/generic" G "github.com/IBM/fp-go/v2/ioeither/generic"
T "github.com/IBM/fp-go/v2/tuple" "github.com/IBM/fp-go/v2/internal/apply"
"github.com/IBM/fp-go/v2/tuple"
) )
// Eitherize0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [IOEither[error, R]] // Eitherize0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [IOEither[error, R]]
@ -29,27 +31,33 @@ func Uneitherize1[F ~func(T1) IOEither[error, R], T1, R any](f F) func(T1) (R, e
return G.Uneitherize1[IOEither[error, R]](f) return G.Uneitherize1[IOEither[error, R]](f)
} }
// SequenceT1 converts 1 [IOEither[E, T]] into a [IOEither[E, T.Tuple1[T1]]] // SequenceT1 converts 1 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple1[T1]]]
func SequenceT1[E, T1 any]( func SequenceT1[E, T1 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
) IOEither[E, T.Tuple1[T1]] { ) IOEither[E, tuple.Tuple1[T1]] {
return G.SequenceT1[ return apply.SequenceT1(
IOEither[E, T.Tuple1[T1]], Map[E, T1, tuple.Tuple1[T1]],
IOEither[E, T1], t1,
](t1) )
} }
// SequenceTuple1 converts a [T.Tuple1[IOEither[E, T]]] into a [IOEither[E, T.Tuple1[T1]]] // SequenceTuple1 converts a [tuple.Tuple1[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple1[T1]]]
func SequenceTuple1[E, T1 any](t T.Tuple1[IOEither[E, T1]]) IOEither[E, T.Tuple1[T1]] { func SequenceTuple1[E, T1 any](t tuple.Tuple1[IOEither[E, T1]]) IOEither[E, tuple.Tuple1[T1]] {
return G.SequenceTuple1[ return apply.SequenceTuple1(
IOEither[E, T.Tuple1[T1]], Map[E, T1, tuple.Tuple1[T1]],
IOEither[E, T1], t,
](t) )
} }
// TraverseTuple1 converts a [T.Tuple1[IOEither[E, T]]] into a [IOEither[E, T.Tuple1[T1]]] // TraverseTuple1 converts a [tuple.Tuple1[A1]] into a [IOEither[E, tuple.Tuple1[T1]]]
func TraverseTuple1[F1 ~func(A1) IOEither[E, T1], E, A1, T1 any](f1 F1) func(T.Tuple1[A1]) IOEither[E, T.Tuple1[T1]] { func TraverseTuple1[E, F1 ~func(A1) IOEither[E, T1], T1, A1 any](f1 F1) func(tuple.Tuple1[A1]) IOEither[E, tuple.Tuple1[T1]] {
return G.TraverseTuple1[IOEither[E, T.Tuple1[T1]]](f1) return func(t tuple.Tuple1[A1]) IOEither[E, tuple.Tuple1[T1]] {
return apply.TraverseTuple1(
Map[E, T1, tuple.Tuple1[T1]],
f1,
t,
)
}
} }
// Eitherize2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [IOEither[error, R]] // Eitherize2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [IOEither[error, R]]
@ -62,30 +70,39 @@ func Uneitherize2[F ~func(T1, T2) IOEither[error, R], T1, T2, R any](f F) func(T
return G.Uneitherize2[IOEither[error, R]](f) return G.Uneitherize2[IOEither[error, R]](f)
} }
// SequenceT2 converts 2 [IOEither[E, T]] into a [IOEither[E, T.Tuple2[T1, T2]]] // SequenceT2 converts 2 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple2[T1, T2]]]
func SequenceT2[E, T1, T2 any]( func SequenceT2[E, T1, T2 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
) IOEither[E, T.Tuple2[T1, T2]] { ) IOEither[E, tuple.Tuple2[T1, T2]] {
return G.SequenceT2[ return apply.SequenceT2(
IOEither[E, T.Tuple2[T1, T2]], Map[E, T1, func(T2) tuple.Tuple2[T1, T2]],
IOEither[E, T1], Ap[tuple.Tuple2[T1, T2], E, T2],
IOEither[E, T2], t1,
](t1, t2) t2,
)
} }
// SequenceTuple2 converts a [T.Tuple2[IOEither[E, T]]] into a [IOEither[E, T.Tuple2[T1, T2]]] // SequenceTuple2 converts a [tuple.Tuple2[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple2[T1, T2]]]
func SequenceTuple2[E, T1, T2 any](t T.Tuple2[IOEither[E, T1], IOEither[E, T2]]) IOEither[E, T.Tuple2[T1, T2]] { func SequenceTuple2[E, T1, T2 any](t tuple.Tuple2[IOEither[E, T1], IOEither[E, T2]]) IOEither[E, tuple.Tuple2[T1, T2]] {
return G.SequenceTuple2[ return apply.SequenceTuple2(
IOEither[E, T.Tuple2[T1, T2]], Map[E, T1, func(T2) tuple.Tuple2[T1, T2]],
IOEither[E, T1], Ap[tuple.Tuple2[T1, T2], E, T2],
IOEither[E, T2], t,
](t) )
} }
// TraverseTuple2 converts a [T.Tuple2[IOEither[E, T]]] into a [IOEither[E, T.Tuple2[T1, T2]]] // TraverseTuple2 converts a [tuple.Tuple2[A1, A2]] into a [IOEither[E, tuple.Tuple2[T1, T2]]]
func TraverseTuple2[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], E, A1, A2, T1, T2 any](f1 F1, f2 F2) func(T.Tuple2[A1, A2]) IOEither[E, T.Tuple2[T1, T2]] { func TraverseTuple2[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], T1, T2, A1, A2 any](f1 F1, f2 F2) func(tuple.Tuple2[A1, A2]) IOEither[E, tuple.Tuple2[T1, T2]] {
return G.TraverseTuple2[IOEither[E, T.Tuple2[T1, T2]]](f1, f2) return func(t tuple.Tuple2[A1, A2]) IOEither[E, tuple.Tuple2[T1, T2]] {
return apply.TraverseTuple2(
Map[E, T1, func(T2) tuple.Tuple2[T1, T2]],
Ap[tuple.Tuple2[T1, T2], E, T2],
f1,
f2,
t,
)
}
} }
// Eitherize3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [IOEither[error, R]] // Eitherize3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [IOEither[error, R]]
@ -98,33 +115,45 @@ func Uneitherize3[F ~func(T1, T2, T3) IOEither[error, R], T1, T2, T3, R any](f F
return G.Uneitherize3[IOEither[error, R]](f) return G.Uneitherize3[IOEither[error, R]](f)
} }
// SequenceT3 converts 3 [IOEither[E, T]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]] // SequenceT3 converts 3 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple3[T1, T2, T3]]]
func SequenceT3[E, T1, T2, T3 any]( func SequenceT3[E, T1, T2, T3 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
t3 IOEither[E, T3], t3 IOEither[E, T3],
) IOEither[E, T.Tuple3[T1, T2, T3]] { ) IOEither[E, tuple.Tuple3[T1, T2, T3]] {
return G.SequenceT3[ return apply.SequenceT3(
IOEither[E, T.Tuple3[T1, T2, T3]], Map[E, T1, func(T2) func(T3) tuple.Tuple3[T1, T2, T3]],
IOEither[E, T1], Ap[func(T3) tuple.Tuple3[T1, T2, T3], E, T2],
IOEither[E, T2], Ap[tuple.Tuple3[T1, T2, T3], E, T3],
IOEither[E, T3], t1,
](t1, t2, t3) t2,
t3,
)
} }
// SequenceTuple3 converts a [T.Tuple3[IOEither[E, T]]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]] // SequenceTuple3 converts a [tuple.Tuple3[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple3[T1, T2, T3]]]
func SequenceTuple3[E, T1, T2, T3 any](t T.Tuple3[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3]]) IOEither[E, T.Tuple3[T1, T2, T3]] { func SequenceTuple3[E, T1, T2, T3 any](t tuple.Tuple3[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3]]) IOEither[E, tuple.Tuple3[T1, T2, T3]] {
return G.SequenceTuple3[ return apply.SequenceTuple3(
IOEither[E, T.Tuple3[T1, T2, T3]], Map[E, T1, func(T2) func(T3) tuple.Tuple3[T1, T2, T3]],
IOEither[E, T1], Ap[func(T3) tuple.Tuple3[T1, T2, T3], E, T2],
IOEither[E, T2], Ap[tuple.Tuple3[T1, T2, T3], E, T3],
IOEither[E, T3], t,
](t) )
} }
// TraverseTuple3 converts a [T.Tuple3[IOEither[E, T]]] into a [IOEither[E, T.Tuple3[T1, T2, T3]]] // TraverseTuple3 converts a [tuple.Tuple3[A1, A2, A3]] into a [IOEither[E, tuple.Tuple3[T1, T2, T3]]]
func TraverseTuple3[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], E, A1, A2, A3, T1, T2, T3 any](f1 F1, f2 F2, f3 F3) func(T.Tuple3[A1, A2, A3]) IOEither[E, T.Tuple3[T1, T2, T3]] { func TraverseTuple3[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], T1, T2, T3, A1, A2, A3 any](f1 F1, f2 F2, f3 F3) func(tuple.Tuple3[A1, A2, A3]) IOEither[E, tuple.Tuple3[T1, T2, T3]] {
return G.TraverseTuple3[IOEither[E, T.Tuple3[T1, T2, T3]]](f1, f2, f3) return func(t tuple.Tuple3[A1, A2, A3]) IOEither[E, tuple.Tuple3[T1, T2, T3]] {
return apply.TraverseTuple3(
Map[E, T1, func(T2) func(T3) tuple.Tuple3[T1, T2, T3]],
Ap[func(T3) tuple.Tuple3[T1, T2, T3], E, T2],
Ap[tuple.Tuple3[T1, T2, T3], E, T3],
f1,
f2,
f3,
t,
)
}
} }
// Eitherize4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [IOEither[error, R]] // Eitherize4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [IOEither[error, R]]
@ -137,36 +166,51 @@ func Uneitherize4[F ~func(T1, T2, T3, T4) IOEither[error, R], T1, T2, T3, T4, R
return G.Uneitherize4[IOEither[error, R]](f) return G.Uneitherize4[IOEither[error, R]](f)
} }
// SequenceT4 converts 4 [IOEither[E, T]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]] // SequenceT4 converts 4 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple4[T1, T2, T3, T4]]]
func SequenceT4[E, T1, T2, T3, T4 any]( func SequenceT4[E, T1, T2, T3, T4 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
t3 IOEither[E, T3], t3 IOEither[E, T3],
t4 IOEither[E, T4], t4 IOEither[E, T4],
) IOEither[E, T.Tuple4[T1, T2, T3, T4]] { ) IOEither[E, tuple.Tuple4[T1, T2, T3, T4]] {
return G.SequenceT4[ return apply.SequenceT4(
IOEither[E, T.Tuple4[T1, T2, T3, T4]], Map[E, T1, func(T2) func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4]],
IOEither[E, T1], Ap[func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T2],
IOEither[E, T2], Ap[func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T3],
IOEither[E, T3], Ap[tuple.Tuple4[T1, T2, T3, T4], E, T4],
IOEither[E, T4], t1,
](t1, t2, t3, t4) t2,
t3,
t4,
)
} }
// SequenceTuple4 converts a [T.Tuple4[IOEither[E, T]]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]] // SequenceTuple4 converts a [tuple.Tuple4[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple4[T1, T2, T3, T4]]]
func SequenceTuple4[E, T1, T2, T3, T4 any](t T.Tuple4[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4]]) IOEither[E, T.Tuple4[T1, T2, T3, T4]] { func SequenceTuple4[E, T1, T2, T3, T4 any](t tuple.Tuple4[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4]]) IOEither[E, tuple.Tuple4[T1, T2, T3, T4]] {
return G.SequenceTuple4[ return apply.SequenceTuple4(
IOEither[E, T.Tuple4[T1, T2, T3, T4]], Map[E, T1, func(T2) func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4]],
IOEither[E, T1], Ap[func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T2],
IOEither[E, T2], Ap[func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T3],
IOEither[E, T3], Ap[tuple.Tuple4[T1, T2, T3, T4], E, T4],
IOEither[E, T4], t,
](t) )
} }
// TraverseTuple4 converts a [T.Tuple4[IOEither[E, T]]] into a [IOEither[E, T.Tuple4[T1, T2, T3, T4]]] // TraverseTuple4 converts a [tuple.Tuple4[A1, A2, A3, A4]] into a [IOEither[E, tuple.Tuple4[T1, T2, T3, T4]]]
func TraverseTuple4[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], E, A1, A2, A3, A4, T1, T2, T3, T4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(T.Tuple4[A1, A2, A3, A4]) IOEither[E, T.Tuple4[T1, T2, T3, T4]] { func TraverseTuple4[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], T1, T2, T3, T4, A1, A2, A3, A4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(tuple.Tuple4[A1, A2, A3, A4]) IOEither[E, tuple.Tuple4[T1, T2, T3, T4]] {
return G.TraverseTuple4[IOEither[E, T.Tuple4[T1, T2, T3, T4]]](f1, f2, f3, f4) return func(t tuple.Tuple4[A1, A2, A3, A4]) IOEither[E, tuple.Tuple4[T1, T2, T3, T4]] {
return apply.TraverseTuple4(
Map[E, T1, func(T2) func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4]],
Ap[func(T3) func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T2],
Ap[func(T4) tuple.Tuple4[T1, T2, T3, T4], E, T3],
Ap[tuple.Tuple4[T1, T2, T3, T4], E, T4],
f1,
f2,
f3,
f4,
t,
)
}
} }
// Eitherize5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [IOEither[error, R]] // Eitherize5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [IOEither[error, R]]
@ -179,39 +223,57 @@ func Uneitherize5[F ~func(T1, T2, T3, T4, T5) IOEither[error, R], T1, T2, T3, T4
return G.Uneitherize5[IOEither[error, R]](f) return G.Uneitherize5[IOEither[error, R]](f)
} }
// SequenceT5 converts 5 [IOEither[E, T]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]] // SequenceT5 converts 5 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceT5[E, T1, T2, T3, T4, T5 any]( func SequenceT5[E, T1, T2, T3, T4, T5 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
t3 IOEither[E, T3], t3 IOEither[E, T3],
t4 IOEither[E, T4], t4 IOEither[E, T4],
t5 IOEither[E, T5], t5 IOEither[E, T5],
) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]] { ) IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]] {
return G.SequenceT5[ return apply.SequenceT5(
IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T3],
IOEither[E, T3], Ap[func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T4],
IOEither[E, T4], Ap[tuple.Tuple5[T1, T2, T3, T4, T5], E, T5],
IOEither[E, T5], t1,
](t1, t2, t3, t4, t5) t2,
t3,
t4,
t5,
)
} }
// SequenceTuple5 converts a [T.Tuple5[IOEither[E, T]]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]] // SequenceTuple5 converts a [tuple.Tuple5[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]]]
func SequenceTuple5[E, T1, T2, T3, T4, T5 any](t T.Tuple5[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5]]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]] { func SequenceTuple5[E, T1, T2, T3, T4, T5 any](t tuple.Tuple5[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5]]) IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]] {
return G.SequenceTuple5[ return apply.SequenceTuple5(
IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T3],
IOEither[E, T3], Ap[func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T4],
IOEither[E, T4], Ap[tuple.Tuple5[T1, T2, T3, T4, T5], E, T5],
IOEither[E, T5], t,
](t) )
} }
// TraverseTuple5 converts a [T.Tuple5[IOEither[E, T]]] into a [IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]] // TraverseTuple5 converts a [tuple.Tuple5[A1, A2, A3, A4, A5]] into a [IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]]]
func TraverseTuple5[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], E, A1, A2, A3, A4, A5, T1, T2, T3, T4, T5 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(T.Tuple5[A1, A2, A3, A4, A5]) IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]] { func TraverseTuple5[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], T1, T2, T3, T4, T5, A1, A2, A3, A4, A5 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(tuple.Tuple5[A1, A2, A3, A4, A5]) IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]] {
return G.TraverseTuple5[IOEither[E, T.Tuple5[T1, T2, T3, T4, T5]]](f1, f2, f3, f4, f5) return func(t tuple.Tuple5[A1, A2, A3, A4, A5]) IOEither[E, tuple.Tuple5[T1, T2, T3, T4, T5]] {
return apply.TraverseTuple5(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5]],
Ap[func(T3) func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T2],
Ap[func(T4) func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T3],
Ap[func(T5) tuple.Tuple5[T1, T2, T3, T4, T5], E, T4],
Ap[tuple.Tuple5[T1, T2, T3, T4, T5], E, T5],
f1,
f2,
f3,
f4,
f5,
t,
)
}
} }
// Eitherize6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [IOEither[error, R]] // Eitherize6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [IOEither[error, R]]
@ -224,7 +286,7 @@ func Uneitherize6[F ~func(T1, T2, T3, T4, T5, T6) IOEither[error, R], T1, T2, T3
return G.Uneitherize6[IOEither[error, R]](f) return G.Uneitherize6[IOEither[error, R]](f)
} }
// SequenceT6 converts 6 [IOEither[E, T]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]] // SequenceT6 converts 6 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceT6[E, T1, T2, T3, T4, T5, T6 any]( func SequenceT6[E, T1, T2, T3, T4, T5, T6 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
@ -232,34 +294,55 @@ func SequenceT6[E, T1, T2, T3, T4, T5, T6 any](
t4 IOEither[E, T4], t4 IOEither[E, T4],
t5 IOEither[E, T5], t5 IOEither[E, T5],
t6 IOEither[E, T6], t6 IOEither[E, T6],
) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]] { ) IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]] {
return G.SequenceT6[ return apply.SequenceT6(
IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T4],
IOEither[E, T4], Ap[func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T5],
IOEither[E, T5], Ap[tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T6],
IOEither[E, T6], t1,
](t1, t2, t3, t4, t5, t6) t2,
t3,
t4,
t5,
t6,
)
} }
// SequenceTuple6 converts a [T.Tuple6[IOEither[E, T]]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]] // SequenceTuple6 converts a [tuple.Tuple6[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]]]
func SequenceTuple6[E, T1, T2, T3, T4, T5, T6 any](t T.Tuple6[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6]]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]] { func SequenceTuple6[E, T1, T2, T3, T4, T5, T6 any](t tuple.Tuple6[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6]]) IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]] {
return G.SequenceTuple6[ return apply.SequenceTuple6(
IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T4],
IOEither[E, T4], Ap[func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T5],
IOEither[E, T5], Ap[tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T6],
IOEither[E, T6], t,
](t) )
} }
// TraverseTuple6 converts a [T.Tuple6[IOEither[E, T]]] into a [IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]] // TraverseTuple6 converts a [tuple.Tuple6[A1, A2, A3, A4, A5, A6]] into a [IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]]]
func TraverseTuple6[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], E, A1, A2, A3, A4, A5, A6, T1, T2, T3, T4, T5, T6 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(T.Tuple6[A1, A2, A3, A4, A5, A6]) IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]] { func TraverseTuple6[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], T1, T2, T3, T4, T5, T6, A1, A2, A3, A4, A5, A6 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(tuple.Tuple6[A1, A2, A3, A4, A5, A6]) IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]] {
return G.TraverseTuple6[IOEither[E, T.Tuple6[T1, T2, T3, T4, T5, T6]]](f1, f2, f3, f4, f5, f6) return func(t tuple.Tuple6[A1, A2, A3, A4, A5, A6]) IOEither[E, tuple.Tuple6[T1, T2, T3, T4, T5, T6]] {
return apply.TraverseTuple6(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6]],
Ap[func(T3) func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T2],
Ap[func(T4) func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T3],
Ap[func(T5) func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T4],
Ap[func(T6) tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T5],
Ap[tuple.Tuple6[T1, T2, T3, T4, T5, T6], E, T6],
f1,
f2,
f3,
f4,
f5,
f6,
t,
)
}
} }
// Eitherize7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [IOEither[error, R]] // Eitherize7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [IOEither[error, R]]
@ -272,7 +355,7 @@ func Uneitherize7[F ~func(T1, T2, T3, T4, T5, T6, T7) IOEither[error, R], T1, T2
return G.Uneitherize7[IOEither[error, R]](f) return G.Uneitherize7[IOEither[error, R]](f)
} }
// SequenceT7 converts 7 [IOEither[E, T]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]] // SequenceT7 converts 7 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceT7[E, T1, T2, T3, T4, T5, T6, T7 any]( func SequenceT7[E, T1, T2, T3, T4, T5, T6, T7 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
@ -281,36 +364,60 @@ func SequenceT7[E, T1, T2, T3, T4, T5, T6, T7 any](
t5 IOEither[E, T5], t5 IOEither[E, T5],
t6 IOEither[E, T6], t6 IOEither[E, T6],
t7 IOEither[E, T7], t7 IOEither[E, T7],
) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]] { ) IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
return G.SequenceT7[ return apply.SequenceT7(
IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T5],
IOEither[E, T5], Ap[func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T6],
IOEither[E, T6], Ap[tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T7],
IOEither[E, T7], t1,
](t1, t2, t3, t4, t5, t6, t7) t2,
t3,
t4,
t5,
t6,
t7,
)
} }
// SequenceTuple7 converts a [T.Tuple7[IOEither[E, T]]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]] // SequenceTuple7 converts a [tuple.Tuple7[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func SequenceTuple7[E, T1, T2, T3, T4, T5, T6, T7 any](t T.Tuple7[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7]]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]] { func SequenceTuple7[E, T1, T2, T3, T4, T5, T6, T7 any](t tuple.Tuple7[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7]]) IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
return G.SequenceTuple7[ return apply.SequenceTuple7(
IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T5],
IOEither[E, T5], Ap[func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T6],
IOEither[E, T6], Ap[tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T7],
IOEither[E, T7], t,
](t) )
} }
// TraverseTuple7 converts a [T.Tuple7[IOEither[E, T]]] into a [IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]] // TraverseTuple7 converts a [tuple.Tuple7[A1, A2, A3, A4, A5, A6, A7]] into a [IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]]]
func TraverseTuple7[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], E, A1, A2, A3, A4, A5, A6, A7, T1, T2, T3, T4, T5, T6, T7 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(T.Tuple7[A1, A2, A3, A4, A5, A6, A7]) IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]] { func TraverseTuple7[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], T1, T2, T3, T4, T5, T6, T7, A1, A2, A3, A4, A5, A6, A7 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(tuple.Tuple7[A1, A2, A3, A4, A5, A6, A7]) IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
return G.TraverseTuple7[IOEither[E, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]](f1, f2, f3, f4, f5, f6, f7) return func(t tuple.Tuple7[A1, A2, A3, A4, A5, A6, A7]) IOEither[E, tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
return apply.TraverseTuple7(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7]],
Ap[func(T3) func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T2],
Ap[func(T4) func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T3],
Ap[func(T5) func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T4],
Ap[func(T6) func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T5],
Ap[func(T7) tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T6],
Ap[tuple.Tuple7[T1, T2, T3, T4, T5, T6, T7], E, T7],
f1,
f2,
f3,
f4,
f5,
f6,
f7,
t,
)
}
} }
// Eitherize8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [IOEither[error, R]] // Eitherize8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [IOEither[error, R]]
@ -323,7 +430,7 @@ func Uneitherize8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) IOEither[error, R], T1
return G.Uneitherize8[IOEither[error, R]](f) return G.Uneitherize8[IOEither[error, R]](f)
} }
// SequenceT8 converts 8 [IOEither[E, T]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]] // SequenceT8 converts 8 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceT8[E, T1, T2, T3, T4, T5, T6, T7, T8 any]( func SequenceT8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
@ -333,38 +440,65 @@ func SequenceT8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](
t6 IOEither[E, T6], t6 IOEither[E, T6],
t7 IOEither[E, T7], t7 IOEither[E, T7],
t8 IOEither[E, T8], t8 IOEither[E, T8],
) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] { ) IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
return G.SequenceT8[ return apply.SequenceT8(
IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T6],
IOEither[E, T6], Ap[func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T7],
IOEither[E, T7], Ap[tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T8],
IOEither[E, T8], t1,
](t1, t2, t3, t4, t5, t6, t7, t8) t2,
t3,
t4,
t5,
t6,
t7,
t8,
)
} }
// SequenceTuple8 converts a [T.Tuple8[IOEither[E, T]]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]] // SequenceTuple8 converts a [tuple.Tuple8[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func SequenceTuple8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](t T.Tuple8[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8]]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] { func SequenceTuple8[E, T1, T2, T3, T4, T5, T6, T7, T8 any](t tuple.Tuple8[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8]]) IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
return G.SequenceTuple8[ return apply.SequenceTuple8(
IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T6],
IOEither[E, T6], Ap[func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T7],
IOEither[E, T7], Ap[tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T8],
IOEither[E, T8], t,
](t) )
} }
// TraverseTuple8 converts a [T.Tuple8[IOEither[E, T]]] into a [IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]] // TraverseTuple8 converts a [tuple.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]] into a [IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]]
func TraverseTuple8[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], E, A1, A2, A3, A4, A5, A6, A7, A8, T1, T2, T3, T4, T5, T6, T7, T8 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(T.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]) IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] { func TraverseTuple8[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], T1, T2, T3, T4, T5, T6, T7, T8, A1, A2, A3, A4, A5, A6, A7, A8 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(tuple.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]) IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
return G.TraverseTuple8[IOEither[E, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]](f1, f2, f3, f4, f5, f6, f7, f8) return func(t tuple.Tuple8[A1, A2, A3, A4, A5, A6, A7, A8]) IOEither[E, tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
return apply.TraverseTuple8(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]],
Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T2],
Ap[func(T4) func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T3],
Ap[func(T5) func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T4],
Ap[func(T6) func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T5],
Ap[func(T7) func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T6],
Ap[func(T8) tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T7],
Ap[tuple.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8], E, T8],
f1,
f2,
f3,
f4,
f5,
f6,
f7,
f8,
t,
)
}
} }
// Eitherize9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [IOEither[error, R]] // Eitherize9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [IOEither[error, R]]
@ -377,7 +511,7 @@ func Uneitherize9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) IOEither[error, R]
return G.Uneitherize9[IOEither[error, R]](f) return G.Uneitherize9[IOEither[error, R]](f)
} }
// SequenceT9 converts 9 [IOEither[E, T]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]] // SequenceT9 converts 9 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func SequenceT9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any]( func SequenceT9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
@ -388,40 +522,70 @@ func SequenceT9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](
t7 IOEither[E, T7], t7 IOEither[E, T7],
t8 IOEither[E, T8], t8 IOEither[E, T8],
t9 IOEither[E, T9], t9 IOEither[E, T9],
) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] { ) IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
return G.SequenceT9[ return apply.SequenceT9(
IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T6],
IOEither[E, T6], Ap[func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T7],
IOEither[E, T7], Ap[func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T8],
IOEither[E, T8], Ap[tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T9],
IOEither[E, T9], t1,
](t1, t2, t3, t4, t5, t6, t7, t8, t9) t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9,
)
} }
// SequenceTuple9 converts a [T.Tuple9[IOEither[E, T]]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]] // SequenceTuple9 converts a [tuple.Tuple9[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func SequenceTuple9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t T.Tuple9[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9]]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] { func SequenceTuple9[E, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t tuple.Tuple9[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9]]) IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
return G.SequenceTuple9[ return apply.SequenceTuple9(
IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T6],
IOEither[E, T6], Ap[func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T7],
IOEither[E, T7], Ap[func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T8],
IOEither[E, T8], Ap[tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T9],
IOEither[E, T9], t,
](t) )
} }
// TraverseTuple9 converts a [T.Tuple9[IOEither[E, T]]] into a [IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]] // TraverseTuple9 converts a [tuple.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]] into a [IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]]
func TraverseTuple9[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(T.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]) IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] { func TraverseTuple9[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], T1, T2, T3, T4, T5, T6, T7, T8, T9, A1, A2, A3, A4, A5, A6, A7, A8, A9 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(tuple.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]) IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
return G.TraverseTuple9[IOEither[E, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]](f1, f2, f3, f4, f5, f6, f7, f8, f9) return func(t tuple.Tuple9[A1, A2, A3, A4, A5, A6, A7, A8, A9]) IOEither[E, tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
return apply.TraverseTuple9(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]],
Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T2],
Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T3],
Ap[func(T5) func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T4],
Ap[func(T6) func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T5],
Ap[func(T7) func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T6],
Ap[func(T8) func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T7],
Ap[func(T9) tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T8],
Ap[tuple.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9], E, T9],
f1,
f2,
f3,
f4,
f5,
f6,
f7,
f8,
f9,
t,
)
}
} }
// Eitherize10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [IOEither[error, R]] // Eitherize10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [IOEither[error, R]]
@ -434,7 +598,7 @@ func Uneitherize10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) IOEither[err
return G.Uneitherize10[IOEither[error, R]](f) return G.Uneitherize10[IOEither[error, R]](f)
} }
// SequenceT10 converts 10 [IOEither[E, T]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]] // SequenceT10 converts 10 [IOEither[E, T]] into a [IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceT10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any]( func SequenceT10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](
t1 IOEither[E, T1], t1 IOEither[E, T1],
t2 IOEither[E, T2], t2 IOEither[E, T2],
@ -446,40 +610,73 @@ func SequenceT10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](
t8 IOEither[E, T8], t8 IOEither[E, T8],
t9 IOEither[E, T9], t9 IOEither[E, T9],
t10 IOEither[E, T10], t10 IOEither[E, T10],
) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] { ) IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
return G.SequenceT10[ return apply.SequenceT10(
IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T6],
IOEither[E, T6], Ap[func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T7],
IOEither[E, T7], Ap[func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T8],
IOEither[E, T8], Ap[func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T9],
IOEither[E, T9], Ap[tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T10],
IOEither[E, T10], t1,
](t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9,
t10,
)
} }
// SequenceTuple10 converts a [T.Tuple10[IOEither[E, T]]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]] // SequenceTuple10 converts a [tuple.Tuple10[IOEither[E, T]]] into a [IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func SequenceTuple10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t T.Tuple10[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9], IOEither[E, T10]]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] { func SequenceTuple10[E, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t tuple.Tuple10[IOEither[E, T1], IOEither[E, T2], IOEither[E, T3], IOEither[E, T4], IOEither[E, T5], IOEither[E, T6], IOEither[E, T7], IOEither[E, T8], IOEither[E, T9], IOEither[E, T10]]) IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
return G.SequenceTuple10[ return apply.SequenceTuple10(
IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]],
IOEither[E, T1], Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T2],
IOEither[E, T2], Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T3],
IOEither[E, T3], Ap[func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T4],
IOEither[E, T4], Ap[func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T5],
IOEither[E, T5], Ap[func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T6],
IOEither[E, T6], Ap[func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T7],
IOEither[E, T7], Ap[func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T8],
IOEither[E, T8], Ap[func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T9],
IOEither[E, T9], Ap[tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T10],
IOEither[E, T10], t,
](t) )
} }
// TraverseTuple10 converts a [T.Tuple10[IOEither[E, T]]] into a [IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]] // TraverseTuple10 converts a [tuple.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]] into a [IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]]
func TraverseTuple10[F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], F10 ~func(A10) IOEither[E, T10], E, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(T.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]) IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] { func TraverseTuple10[E, F1 ~func(A1) IOEither[E, T1], F2 ~func(A2) IOEither[E, T2], F3 ~func(A3) IOEither[E, T3], F4 ~func(A4) IOEither[E, T4], F5 ~func(A5) IOEither[E, T5], F6 ~func(A6) IOEither[E, T6], F7 ~func(A7) IOEither[E, T7], F8 ~func(A8) IOEither[E, T8], F9 ~func(A9) IOEither[E, T9], F10 ~func(A10) IOEither[E, T10], T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(tuple.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]) IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
return G.TraverseTuple10[IOEither[E, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]](f1, f2, f3, f4, f5, f6, f7, f8, f9, f10) return func(t tuple.Tuple10[A1, A2, A3, A4, A5, A6, A7, A8, A9, A10]) IOEither[E, tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
return apply.TraverseTuple10(
Map[E, T1, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]],
Ap[func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T2],
Ap[func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T3],
Ap[func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T4],
Ap[func(T6) func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T5],
Ap[func(T7) func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T6],
Ap[func(T8) func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T7],
Ap[func(T9) func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T8],
Ap[func(T10) tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T9],
Ap[tuple.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10], E, T10],
f1,
f2,
f3,
f4,
f5,
f6,
f7,
f8,
f9,
f10,
t,
)
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
// Copyright (c) 2023 IBM Corp.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package generic
import (
"context"
G "github.com/IBM/fp-go/v2/io/generic"
O "github.com/IBM/fp-go/v2/option"
)
// WithLock executes the provided IO operation in the scope of a lock
func WithLock[GA ~func() O.Option[A], A any](lock func() context.CancelFunc) func(fa GA) GA {
return G.WithLock[GA](lock)
}

View File

@ -18,11 +18,11 @@ package iooption
import ( import (
"context" "context"
IO "github.com/IBM/fp-go/v2/io" "github.com/IBM/fp-go/v2/io"
G "github.com/IBM/fp-go/v2/iooption/generic" "github.com/IBM/fp-go/v2/option"
) )
// WithLock executes the provided IO operation in the scope of a lock // WithLock executes the provided IO operation in the scope of a lock
func WithLock[E, A any](lock IO.IO[context.CancelFunc]) func(fa IOOption[A]) IOOption[A] { func WithLock[E, A any](lock io.IO[context.CancelFunc]) func(fa IOOption[A]) IOOption[A] {
return G.WithLock[IOOption[A]](lock) return io.WithLock[option.Option[A]](lock)
} }

View File

@ -1,34 +0,0 @@
// Copyright (c) 2023 IBM Corp.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package generic
import (
"context"
F "github.com/IBM/fp-go/v2/function"
G "github.com/IBM/fp-go/v2/io/generic"
)
// WithLock executes the provided IO operation in the scope of a lock
func WithLock[GEA ~func(R) GIOA, GIOA ~func() A, R, A any](lock func() context.CancelFunc) func(fa GEA) GEA {
l := G.WithLock[GIOA](lock)
return func(fa GEA) GEA {
return F.Flow2(
fa,
l,
)
}
}

View File

@ -18,10 +18,17 @@ package readerio
import ( import (
"context" "context"
G "github.com/IBM/fp-go/v2/readerio/generic" "github.com/IBM/fp-go/v2/function"
"github.com/IBM/fp-go/v2/io"
) )
// WithLock executes the provided IO operation in the scope of a lock // WithLock executes the provided IO operation in the scope of a lock
func WithLock[R, A any](lock func() context.CancelFunc) func(fa ReaderIO[R, A]) ReaderIO[R, A] { func WithLock[R, A any](lock func() context.CancelFunc) func(fa ReaderIO[R, A]) ReaderIO[R, A] {
return G.WithLock[ReaderIO[R, A]](lock) l := io.WithLock[A](lock)
return func(fa ReaderIO[R, A]) ReaderIO[R, A] {
return function.Flow2(
fa,
l,
)
}
} }

View File

@ -1,28 +0,0 @@
// Copyright (c) 2023 IBM Corp.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package generic
import (
"context"
"github.com/IBM/fp-go/v2/either"
G "github.com/IBM/fp-go/v2/readerio/generic"
)
// WithLock executes the provided IO operation in the scope of a lock
func WithLock[GEA ~func(R) GIOA, GIOA ~func() either.Either[E, A], R, E, A any](lock func() context.CancelFunc) func(fa GEA) GEA {
return G.WithLock[GEA](lock)
}

View File

@ -18,10 +18,11 @@ package readerioeither
import ( import (
"context" "context"
G "github.com/IBM/fp-go/v2/readerioeither/generic" "github.com/IBM/fp-go/v2/either"
"github.com/IBM/fp-go/v2/readerio"
) )
// WithLock executes the provided IO operation in the scope of a lock // WithLock executes the provided IO operation in the scope of a lock
func WithLock[R, E, A any](lock func() context.CancelFunc) func(fa ReaderIOEither[R, E, A]) ReaderIOEither[R, E, A] { func WithLock[R, E, A any](lock func() context.CancelFunc) func(fa ReaderIOEither[R, E, A]) ReaderIOEither[R, E, A] {
return G.WithLock[ReaderIOEither[R, E, A]](lock) return readerio.WithLock[R, either.Either[E, A]](lock)
} }