1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

fix: automate eitherize methods

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-07-18 15:24:00 +02:00
parent 2efe4f64c5
commit eb4975e86d
60 changed files with 2106 additions and 430 deletions

3
readerioeither/doc.go Normal file
View File

@@ -0,0 +1,3 @@
package readerioeither
//go:generate go run .. readerioeither --count 10 --filename gen.go

View File

@@ -1,24 +0,0 @@
package readerioeither
import (
G "github.com/ibm/fp-go/readerioeither/generic"
)
// these functions From a golang function with the context as the firsr parameter into a either reader with the context as the last parameter
// this goes back to the advice in https://pkg.go.dev/context to put the context as a first parameter as a convention
func From0[R, A any](f func(R) func() (A, error)) ReaderIOEither[R, error, A] {
return G.From0[ReaderIOEither[R, error, A]](f)
}
func From1[R, T1, A any](f func(R, T1) func() (A, error)) func(T1) ReaderIOEither[R, error, A] {
return G.From1[ReaderIOEither[R, error, A]](f)
}
func From2[R, T1, T2, A any](f func(R, T1, T2) func() (A, error)) func(T1, T2) ReaderIOEither[R, error, A] {
return G.From2[ReaderIOEither[R, error, A]](f)
}
func From3[R, T1, T2, T3, A any](f func(R, T1, T2, T3) func() (A, error)) func(T1, T2, T3) ReaderIOEither[R, error, A] {
return G.From3[ReaderIOEither[R, error, A]](f)
}

141
readerioeither/gen.go Normal file
View File

@@ -0,0 +1,141 @@
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at
// 2023-07-18 15:21:45.9564072 +0200 CEST m=+0.081399101
package readerioeither
import (
G "github.com/ibm/fp-go/readerioeither/generic"
)
// From0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From0[F ~func(C) func() (R, error), C, R any](f F) func() ReaderIOEither[C, error, R] {
return G.From0[ReaderIOEither[C, error, R]](f)
}
// Eitherize0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize0[F ~func(C) (R, error), C, R any](f F) func() ReaderIOEither[C, error, R] {
return G.Eitherize0[ReaderIOEither[C, error, R]](f)
}
// From1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From1[F ~func(C, T0) func() (R, error), T0, C, R any](f F) func(T0) ReaderIOEither[C, error, R] {
return G.From1[ReaderIOEither[C, error, R]](f)
}
// Eitherize1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize1[F ~func(C, T0) (R, error), T0, C, R any](f F) func(T0) ReaderIOEither[C, error, R] {
return G.Eitherize1[ReaderIOEither[C, error, R]](f)
}
// From2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From2[F ~func(C, T0, T1) func() (R, error), T0, T1, C, R any](f F) func(T0, T1) ReaderIOEither[C, error, R] {
return G.From2[ReaderIOEither[C, error, R]](f)
}
// Eitherize2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize2[F ~func(C, T0, T1) (R, error), T0, T1, C, R any](f F) func(T0, T1) ReaderIOEither[C, error, R] {
return G.Eitherize2[ReaderIOEither[C, error, R]](f)
}
// From3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From3[F ~func(C, T0, T1, T2) func() (R, error), T0, T1, T2, C, R any](f F) func(T0, T1, T2) ReaderIOEither[C, error, R] {
return G.From3[ReaderIOEither[C, error, R]](f)
}
// Eitherize3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize3[F ~func(C, T0, T1, T2) (R, error), T0, T1, T2, C, R any](f F) func(T0, T1, T2) ReaderIOEither[C, error, R] {
return G.Eitherize3[ReaderIOEither[C, error, R]](f)
}
// From4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From4[F ~func(C, T0, T1, T2, T3) func() (R, error), T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) ReaderIOEither[C, error, R] {
return G.From4[ReaderIOEither[C, error, R]](f)
}
// Eitherize4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize4[F ~func(C, T0, T1, T2, T3) (R, error), T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) ReaderIOEither[C, error, R] {
return G.Eitherize4[ReaderIOEither[C, error, R]](f)
}
// From5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From5[F ~func(C, T0, T1, T2, T3, T4) func() (R, error), T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) ReaderIOEither[C, error, R] {
return G.From5[ReaderIOEither[C, error, R]](f)
}
// Eitherize5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize5[F ~func(C, T0, T1, T2, T3, T4) (R, error), T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) ReaderIOEither[C, error, R] {
return G.Eitherize5[ReaderIOEither[C, error, R]](f)
}
// From6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From6[F ~func(C, T0, T1, T2, T3, T4, T5) func() (R, error), T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) ReaderIOEither[C, error, R] {
return G.From6[ReaderIOEither[C, error, R]](f)
}
// Eitherize6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize6[F ~func(C, T0, T1, T2, T3, T4, T5) (R, error), T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) ReaderIOEither[C, error, R] {
return G.Eitherize6[ReaderIOEither[C, error, R]](f)
}
// From7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From7[F ~func(C, T0, T1, T2, T3, T4, T5, T6) func() (R, error), T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) ReaderIOEither[C, error, R] {
return G.From7[ReaderIOEither[C, error, R]](f)
}
// Eitherize7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize7[F ~func(C, T0, T1, T2, T3, T4, T5, T6) (R, error), T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) ReaderIOEither[C, error, R] {
return G.Eitherize7[ReaderIOEither[C, error, R]](f)
}
// From8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From8[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) func() (R, error), T0, T1, T2, T3, T4, T5, T6, T7, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) ReaderIOEither[C, error, R] {
return G.From8[ReaderIOEither[C, error, R]](f)
}
// Eitherize8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize8[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) ReaderIOEither[C, error, R] {
return G.Eitherize8[ReaderIOEither[C, error, R]](f)
}
// From9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From9[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) func() (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) ReaderIOEither[C, error, R] {
return G.From9[ReaderIOEither[C, error, R]](f)
}
// Eitherize9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize9[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) ReaderIOEither[C, error, R] {
return G.Eitherize9[ReaderIOEither[C, error, R]](f)
}
// From10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [ReaderIOEither[R]]
// The first parameter is considered to be the context [C].
func From10[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) func() (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) ReaderIOEither[C, error, R] {
return G.From10[ReaderIOEither[C, error, R]](f)
}
// Eitherize10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [ReaderIOEither[C, error, R]]
// The first parameter is considered to be the context [C].
func Eitherize10[F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) ReaderIOEither[C, error, R] {
return G.Eitherize10[ReaderIOEither[C, error, R]](f)
}

View File

@@ -1,48 +0,0 @@
package generic
import (
ET "github.com/ibm/fp-go/either"
)
// these functions From a golang function with the context as the first parameter into a either reader with the context as the last parameter
// this goes back to the advice in https://pkg.go.dev/context to put the context as a first parameter as a convention
func Eitherize0[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, A any](f func(R) (A, error)) GEA {
return From0[GEA](func(r R) func() (A, error) {
return func() (A, error) {
return f(r)
}
})
}
func Eitherize1[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, A any](f func(R, T1) (A, error)) func(T1) GEA {
return From1[GEA](func(r R, t1 T1) func() (A, error) {
return func() (A, error) {
return f(r, t1)
}
})
}
func Eitherize2[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, A any](f func(R, T1, T2) (A, error)) func(T1, T2) GEA {
return From2[GEA](func(r R, t1 T1, t2 T2) func() (A, error) {
return func() (A, error) {
return f(r, t1, t2)
}
})
}
func Eitherize3[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, T3, A any](f func(R, T1, T2, T3) (A, error)) func(T1, T2, T3) GEA {
return From3[GEA](func(r R, t1 T1, t2 T2, t3 T3) func() (A, error) {
return func() (A, error) {
return f(r, t1, t2, t3)
}
})
}
func Eitherize4[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, T3, T4, A any](f func(R, T1, T2, T3, T4) (A, error)) func(T1, T2, T3, T4) GEA {
return From4[GEA](func(r R, t1 T1, t2 T2, t3 T3, t4 T4) func() (A, error) {
return func() (A, error) {
return f(r, t1, t2, t3, t4)
}
})
}

View File

@@ -1,39 +0,0 @@
package generic
import (
ET "github.com/ibm/fp-go/either"
G "github.com/ibm/fp-go/reader/generic"
)
// these functions From a golang function with the context as the first parameter into a either reader with the context as the last parameter
// this goes back to the advice in https://pkg.go.dev/context to put the context as a first parameter as a convention
func From0[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, A any](f func(R) func() (A, error)) GEA {
return G.From0[GEA](func(r R) GIOA {
return ET.Eitherize0(f(r))
})
}
func From1[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, A any](f func(R, T1) func() (A, error)) func(T1) GEA {
return G.From1[GEA](func(r R, t1 T1) GIOA {
return ET.Eitherize0(f(r, t1))
})
}
func From2[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, A any](f func(R, T1, T2) func() (A, error)) func(T1, T2) GEA {
return G.From2[GEA](func(r R, t1 T1, t2 T2) GIOA {
return ET.Eitherize0(f(r, t1, t2))
})
}
func From3[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, T3, A any](f func(R, T1, T2, T3) func() (A, error)) func(T1, T2, T3) GEA {
return G.From3[GEA](func(r R, t1 T1, t2 T2, t3 T3) GIOA {
return ET.Eitherize0(f(r, t1, t2, t3))
})
}
func From4[GEA ~func(R) GIOA, GIOA ~func() ET.Either[error, A], R, T1, T2, T3, T4, A any](f func(R, T1, T2, T3, T4) func() (A, error)) func(T1, T2, T3, T4) GEA {
return G.From4[GEA](func(r R, t1 T1, t2 T2, t3 T3, t4 T4) GIOA {
return ET.Eitherize0(f(r, t1, t2, t3, t4))
})
}

View File

@@ -0,0 +1,197 @@
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at
// 2023-07-18 15:21:45.957526 +0200 CEST m=+0.082517901
package generic
import (
E "github.com/ibm/fp-go/either"
RD "github.com/ibm/fp-go/reader/generic"
)
// From0 converts a function with 1 parameters returning a tuple into a function with 0 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From0[GRA ~func(C) GIOA, F ~func(C) func() (R, error), GIOA ~func() E.Either[error, R], C, R any](f F) func() GRA {
return RD.From0[GRA](func(r C) GIOA {
return E.Eitherize0(f(r))
})
}
// Eitherize0 converts a function with 0 parameters returning a tuple into a function with 0 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize0[GRA ~func(C) GIOA, F ~func(C) (R, error), GIOA ~func() E.Either[error, R], C, R any](f F) func() GRA {
return From0[GRA](func(r C) func() (R, error) {
return func() (R, error) {
return f(r)
}})
}
// From1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From1[GRA ~func(C) GIOA, F ~func(C, T0) func() (R, error), GIOA ~func() E.Either[error, R], T0, C, R any](f F) func(T0) GRA {
return RD.From1[GRA](func(r C, t0 T0) GIOA {
return E.Eitherize0(f(r, t0))
})
}
// Eitherize1 converts a function with 1 parameters returning a tuple into a function with 1 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize1[GRA ~func(C) GIOA, F ~func(C, T0) (R, error), GIOA ~func() E.Either[error, R], T0, C, R any](f F) func(T0) GRA {
return From1[GRA](func(r C, t0 T0) func() (R, error) {
return func() (R, error) {
return f(r, t0)
}})
}
// From2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From2[GRA ~func(C) GIOA, F ~func(C, T0, T1) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, C, R any](f F) func(T0, T1) GRA {
return RD.From2[GRA](func(r C, t0 T0, t1 T1) GIOA {
return E.Eitherize0(f(r, t0, t1))
})
}
// Eitherize2 converts a function with 2 parameters returning a tuple into a function with 2 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize2[GRA ~func(C) GIOA, F ~func(C, T0, T1) (R, error), GIOA ~func() E.Either[error, R], T0, T1, C, R any](f F) func(T0, T1) GRA {
return From2[GRA](func(r C, t0 T0, t1 T1) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1)
}})
}
// From3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From3[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, C, R any](f F) func(T0, T1, T2) GRA {
return RD.From3[GRA](func(r C, t0 T0, t1 T1, t2 T2) GIOA {
return E.Eitherize0(f(r, t0, t1, t2))
})
}
// Eitherize3 converts a function with 3 parameters returning a tuple into a function with 3 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize3[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, C, R any](f F) func(T0, T1, T2) GRA {
return From3[GRA](func(r C, t0 T0, t1 T1, t2 T2) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2)
}})
}
// From4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From4[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) GRA {
return RD.From4[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3))
})
}
// Eitherize4 converts a function with 4 parameters returning a tuple into a function with 4 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize4[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, C, R any](f F) func(T0, T1, T2, T3) GRA {
return From4[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3)
}})
}
// From5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From5[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) GRA {
return RD.From5[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4))
})
}
// Eitherize5 converts a function with 5 parameters returning a tuple into a function with 5 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize5[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, C, R any](f F) func(T0, T1, T2, T3, T4) GRA {
return From5[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4)
}})
}
// From6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From6[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) GRA {
return RD.From6[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4, t5))
})
}
// Eitherize6 converts a function with 6 parameters returning a tuple into a function with 6 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize6[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, C, R any](f F) func(T0, T1, T2, T3, T4, T5) GRA {
return From6[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4, t5)
}})
}
// From7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From7[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) GRA {
return RD.From7[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4, t5, t6))
})
}
// Eitherize7 converts a function with 7 parameters returning a tuple into a function with 7 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize7[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) GRA {
return From7[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4, t5, t6)
}})
}
// From8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From8[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) GRA {
return RD.From8[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4, t5, t6, t7))
})
}
// Eitherize8 converts a function with 8 parameters returning a tuple into a function with 8 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize8[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) GRA {
return From8[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4, t5, t6, t7)
}})
}
// From9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From9[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, T8, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) GRA {
return RD.From9[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8))
})
}
// Eitherize9 converts a function with 9 parameters returning a tuple into a function with 9 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize9[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, T8, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) GRA {
return From9[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8)
}})
}
// From10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [GRA]
// The first parameter is considerd to be the context [C].
func From10[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) func() (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) GRA {
return RD.From10[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9) GIOA {
return E.Eitherize0(f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9))
})
}
// Eitherize10 converts a function with 10 parameters returning a tuple into a function with 10 parameters returning a [GRA]
// The first parameter is considered to be the context [C].
func Eitherize10[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, C, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) GRA {
return From10[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9) func() (R, error) {
return func() (R, error) {
return f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9)
}})
}