mirror of
https://github.com/IBM/fp-go.git
synced 2025-06-19 00:17:48 +02:00
fix: auto generate SequenceT for ReaderIOEither
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
@ -15,22 +15,13 @@ func From[A any](data ...A) []A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MakeBy returns a `Array` of length `n` with element `i` initialized with `f(i)`.
|
// MakeBy returns a `Array` of length `n` with element `i` initialized with `f(i)`.
|
||||||
func MakeBy[A any](n int, f func(int) A) []A {
|
func MakeBy[F ~func(int) A, A any](n int, f F) []A {
|
||||||
// sanity check
|
return G.MakeBy[[]A](n, f)
|
||||||
if n <= 0 {
|
|
||||||
return Empty[A]()
|
|
||||||
}
|
|
||||||
// run the generator function across the input
|
|
||||||
as := make([]A, n)
|
|
||||||
for i := n - 1; i >= 0; i-- {
|
|
||||||
as[i] = f(i)
|
|
||||||
}
|
|
||||||
return as
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replicate creates a `Array` containing a value repeated the specified number of times.
|
// Replicate creates a `Array` containing a value repeated the specified number of times.
|
||||||
func Replicate[A any](n int, a A) []A {
|
func Replicate[A any](n int, a A) []A {
|
||||||
return MakeBy(n, F.Constant1[int](a))
|
return G.Replicate[[]A](n, a)
|
||||||
}
|
}
|
||||||
|
|
||||||
func MonadMap[A, B any](as []A, f func(a A) B) []B {
|
func MonadMap[A, B any](as []A, f func(a A) B) []B {
|
||||||
@ -159,21 +150,19 @@ func Of[A any](a A) []A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func MonadChain[A, B any](fa []A, f func(a A) []B) []B {
|
func MonadChain[A, B any](fa []A, f func(a A) []B) []B {
|
||||||
return array.Reduce(fa, func(bs []B, a A) []B {
|
return G.MonadChain[[]A, []B](fa, f)
|
||||||
return append(bs, f(a)...)
|
|
||||||
}, Zero[B]())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Chain[A, B any](f func(a A) []B) func([]A) []B {
|
func Chain[A, B any](f func(A) []B) func([]A) []B {
|
||||||
return F.Bind2nd(MonadChain[A, B], f)
|
return G.Chain[[]A, []B](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
func MonadAp[B, A any](fab []func(A) B, fa []A) []B {
|
func MonadAp[B, A any](fab []func(A) B, fa []A) []B {
|
||||||
return MonadChain(fab, F.Bind1st(MonadMap[A, B], fa))
|
return G.MonadAp[[]B](fab, fa)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Ap[B, A any](fa []A) func([]func(A) B) []B {
|
func Ap[B, A any](fa []A) func([]func(A) B) []B {
|
||||||
return F.Bind2nd(MonadAp[B, A], fa)
|
return G.Ap[[]B, []func(A) B](fa)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Match[A, B any](onEmpty func() B, onNonEmpty func([]A) B) func([]A) B {
|
func Match[A, B any](onEmpty func() B, onNonEmpty func([]A) B) func([]A) B {
|
||||||
|
@ -17,6 +17,24 @@ func From[GA ~[]A, A any](data ...A) GA {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MakeBy returns a `Array` of length `n` with element `i` initialized with `f(i)`.
|
||||||
|
func MakeBy[AS ~[]A, F ~func(int) A, A any](n int, f F) AS {
|
||||||
|
// sanity check
|
||||||
|
if n <= 0 {
|
||||||
|
return Empty[AS]()
|
||||||
|
}
|
||||||
|
// run the generator function across the input
|
||||||
|
as := make(AS, n)
|
||||||
|
for i := n - 1; i >= 0; i-- {
|
||||||
|
as[i] = f(i)
|
||||||
|
}
|
||||||
|
return as
|
||||||
|
}
|
||||||
|
|
||||||
|
func Replicate[AS ~[]A, A any](n int, a A) AS {
|
||||||
|
return MakeBy[AS](n, F.Constant1[int](a))
|
||||||
|
}
|
||||||
|
|
||||||
func Lookup[GA ~[]A, A any](idx int) func(GA) O.Option[A] {
|
func Lookup[GA ~[]A, A any](idx int) func(GA) O.Option[A] {
|
||||||
none := O.None[A]()
|
none := O.None[A]()
|
||||||
if idx < 0 {
|
if idx < 0 {
|
||||||
@ -107,3 +125,21 @@ func MonadPartition[GA ~[]A, A any](as GA, pred func(A) bool) tuple.Tuple2[GA, G
|
|||||||
func Partition[GA ~[]A, A any](pred func(A) bool) func(GA) tuple.Tuple2[GA, GA] {
|
func Partition[GA ~[]A, A any](pred func(A) bool) func(GA) tuple.Tuple2[GA, GA] {
|
||||||
return F.Bind2nd(MonadPartition[GA, A], pred)
|
return F.Bind2nd(MonadPartition[GA, A], pred)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MonadChain[AS ~[]A, BS ~[]B, A, B any](fa AS, f func(a A) BS) BS {
|
||||||
|
return array.Reduce(fa, func(bs BS, a A) BS {
|
||||||
|
return append(bs, f(a)...)
|
||||||
|
}, Empty[BS]())
|
||||||
|
}
|
||||||
|
|
||||||
|
func Chain[AS ~[]A, BS ~[]B, A, B any](f func(A) BS) func(AS) BS {
|
||||||
|
return F.Bind2nd(MonadChain[AS, BS, A, B], f)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MonadAp[BS ~[]B, ABS ~[]func(A) B, AS ~[]A, B, A any](fab ABS, fa AS) BS {
|
||||||
|
return MonadChain(fab, F.Bind1st(MonadMap[AS, BS, A, B], fa))
|
||||||
|
}
|
||||||
|
|
||||||
|
func Ap[BS ~[]B, ABS ~[]func(A) B, AS ~[]A, B, A any](fa AS) func(ABS) BS {
|
||||||
|
return F.Bind2nd(MonadAp[BS, ABS, AS], fa)
|
||||||
|
}
|
||||||
|
@ -5,10 +5,118 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
C "github.com/urfave/cli/v2"
|
C "github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func generateNestedCallbacks(i, total int) string {
|
||||||
|
var buf strings.Builder
|
||||||
|
for j := i; j < total; j++ {
|
||||||
|
if j > i {
|
||||||
|
buf.WriteString(" ")
|
||||||
|
}
|
||||||
|
buf.WriteString(fmt.Sprintf("func(T%d)", j+1))
|
||||||
|
}
|
||||||
|
if i > 0 {
|
||||||
|
buf.WriteString(" ")
|
||||||
|
}
|
||||||
|
buf.WriteString(tupleType(total))
|
||||||
|
return buf.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func generateContextReaderIOEitherSequenceT(f, fg *os.File, i int) {
|
||||||
|
// tuple type
|
||||||
|
tuple := tupleType(i)
|
||||||
|
|
||||||
|
// non-generic version
|
||||||
|
// generic version
|
||||||
|
fmt.Fprintf(f, "\n// SequenceT%d converts %d [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple%d].\n", i, i, i)
|
||||||
|
fmt.Fprintf(f, "func SequenceT%d[", i)
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
if j > 0 {
|
||||||
|
fmt.Fprintf(f, ", ")
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, "T%d", j+1)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, " any](")
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
if j > 0 {
|
||||||
|
fmt.Fprintf(f, ", ")
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, "t%d ReaderIOEither[T%d]", j+1, j+1)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, ") ReaderIOEither[%s] {\n", tuple)
|
||||||
|
fmt.Fprintf(f, " return G.SequenceT%d[ReaderIOEither[%s]](", i, tuple)
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
if j > 0 {
|
||||||
|
fmt.Fprintf(f, ", ")
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, "t%d", j+1)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(f, ")\n")
|
||||||
|
fmt.Fprintf(f, "}\n")
|
||||||
|
|
||||||
|
// generic version
|
||||||
|
fmt.Fprintf(fg, "\n// SequenceT%d converts %d readers into a reader of a [T.Tuple%d].\n", i, i, i)
|
||||||
|
fmt.Fprintf(fg, "func SequenceT%d[\n", i)
|
||||||
|
|
||||||
|
fmt.Fprintf(fg, " GR_TUPLE%d ~func(context.Context) GIO_TUPLE%d,\n", i, i)
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
fmt.Fprintf(fg, " GR_T%d ~func(context.Context) GIO_T%d,\n", j+1, j+1)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Fprintf(fg, " GIO_TUPLE%d ~func() E.Either[error, %s],\n", i, tuple)
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
fmt.Fprintf(fg, " GIO_T%d ~func() E.Either[error, T%d],\n", j+1, j+1)
|
||||||
|
}
|
||||||
|
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
fmt.Fprintf(fg, " T%d", j+1)
|
||||||
|
if j < i-1 {
|
||||||
|
fmt.Fprintf(fg, ",\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Fprintf(fg, " any](\n")
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
fmt.Fprintf(fg, " t%d GR_T%d,\n", j+1, j+1)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(fg, ") GR_TUPLE%d {\n", i)
|
||||||
|
fmt.Fprintf(fg, " return A.SequenceT%d(\n", i)
|
||||||
|
// map call
|
||||||
|
var cr string
|
||||||
|
if i > 1 {
|
||||||
|
cb := generateNestedCallbacks(1, i)
|
||||||
|
cio := fmt.Sprintf("func() E.Either[error, %s]", cb)
|
||||||
|
cr = fmt.Sprintf("func(context.Context) %s", cio)
|
||||||
|
} else {
|
||||||
|
cr = fmt.Sprintf("GR_TUPLE%d", i)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(fg, " Map[GR_T%d, %s, GIO_T%d],\n", 1, cr, 1)
|
||||||
|
// the apply calls
|
||||||
|
for j := 1; j < i; j++ {
|
||||||
|
if j < i-1 {
|
||||||
|
cb := generateNestedCallbacks(j+1, i)
|
||||||
|
cio := fmt.Sprintf("func() E.Either[error, %s]", cb)
|
||||||
|
cr = fmt.Sprintf("func(context.Context) %s", cio)
|
||||||
|
} else {
|
||||||
|
cr = fmt.Sprintf("GR_TUPLE%d", i)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(fg, " Ap[%s, func(context.Context) func() E.Either[error, %s], GR_T%d],\n", cr, generateNestedCallbacks(j, i), j+1)
|
||||||
|
}
|
||||||
|
// raw parameters
|
||||||
|
for j := 0; j < i; j++ {
|
||||||
|
fmt.Fprintf(fg, " t%d,\n", j+1)
|
||||||
|
}
|
||||||
|
// // map
|
||||||
|
// Ap[GB, func(E) func() ET.Either[L, func(C) T.Tuple3[A, B, C]], func(E) func() ET.Either[L, func(B) func(C) T.Tuple3[A, B, C]], GIOB, func() ET.Either[L, func(C) T.Tuple3[A, B, C]], func() ET.Either[L, func(B) func(C) T.Tuple3[A, B, C]], E, L, B, func(C) T.Tuple3[A, B, C]],
|
||||||
|
// Ap[GC, GTABC, func(E) func() ET.Either[L, func(C) T.Tuple3[A, B, C]], GIOC, GIOTABC, func() ET.Either[L, func(C) T.Tuple3[A, B, C]], E, L, C, T.Tuple3[A, B, C]],
|
||||||
|
|
||||||
|
// a, b, c,
|
||||||
|
fmt.Fprintf(fg, " )\n")
|
||||||
|
fmt.Fprintf(fg, "}\n")
|
||||||
|
}
|
||||||
|
|
||||||
func generateContextReaderIOEitherEitherize(f, fg *os.File, i int) {
|
func generateContextReaderIOEitherEitherize(f, fg *os.File, i int) {
|
||||||
// non generic version
|
// non generic version
|
||||||
fmt.Fprintf(f, "\n// Eitherize%d converts a function with %d parameters returning a tuple into a function with %d parameters returning a [ReaderIOEither[R]]\n// The inverse function is [Uneitherize%d]\n", i, i, i, i)
|
fmt.Fprintf(f, "\n// Eitherize%d converts a function with %d parameters returning a tuple into a function with %d parameters returning a [ReaderIOEither[R]]\n// The inverse function is [Uneitherize%d]\n", i, i, i, i)
|
||||||
@ -90,6 +198,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
G "github.com/IBM/fp-go/context/%s/generic"
|
G "github.com/IBM/fp-go/context/%s/generic"
|
||||||
|
T "github.com/IBM/fp-go/tuple"
|
||||||
)
|
)
|
||||||
`, pkg)
|
`, pkg)
|
||||||
|
|
||||||
@ -101,6 +210,8 @@ import (
|
|||||||
|
|
||||||
E "github.com/IBM/fp-go/either"
|
E "github.com/IBM/fp-go/either"
|
||||||
RE "github.com/IBM/fp-go/readerioeither/generic"
|
RE "github.com/IBM/fp-go/readerioeither/generic"
|
||||||
|
A "github.com/IBM/fp-go/internal/apply"
|
||||||
|
T "github.com/IBM/fp-go/tuple"
|
||||||
)
|
)
|
||||||
`)
|
`)
|
||||||
|
|
||||||
@ -109,6 +220,8 @@ import (
|
|||||||
for i := 1; i <= count; i++ {
|
for i := 1; i <= count; i++ {
|
||||||
// eitherize
|
// eitherize
|
||||||
generateContextReaderIOEitherEitherize(f, fg, i)
|
generateContextReaderIOEitherEitherize(f, fg, i)
|
||||||
|
// sequenceT
|
||||||
|
generateContextReaderIOEitherSequenceT(f, fg, i)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -1,4 +1,19 @@
|
|||||||
// Package readerioeither contains a version of [ReaderIOEither] that takes a golang [context.Context] as its context
|
// 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 readerioeither contains a version of [ReaderIOEither] that takes a golang [context.Context] as its context and that assumes the standard go error
|
||||||
package readerioeither
|
package readerioeither
|
||||||
|
|
||||||
//go:generate go run ../.. contextreaderioeither --count 10 --filename gen.go
|
//go:generate go run ../.. contextreaderioeither --count 10 --filename gen.go
|
||||||
|
@ -2,12 +2,13 @@ package readerioeither
|
|||||||
|
|
||||||
// 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
|
||||||
// 2023-07-19 16:18:34.1521763 +0200 CEST m=+0.011558001
|
// 2023-07-20 16:14:27.3155005 +0200 CEST m=+0.020795301
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
G "github.com/IBM/fp-go/context/readerioeither/generic"
|
G "github.com/IBM/fp-go/context/readerioeither/generic"
|
||||||
|
T "github.com/IBM/fp-go/tuple"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Eitherize0 converts a function with 0 parameters returning a tuple into a function with 0 parameters returning a [ReaderIOEither[R]]
|
// Eitherize0 converts a function with 0 parameters returning a tuple into a function with 0 parameters returning a [ReaderIOEither[R]]
|
||||||
@ -22,56 +23,106 @@ func Eitherize1[F ~func(context.Context, T0) (R, error), T0, R any](f F) func(T0
|
|||||||
return G.Eitherize1[ReaderIOEither[R]](f)
|
return G.Eitherize1[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT1 converts 1 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple1].
|
||||||
|
func SequenceT1[T1 any](t1 ReaderIOEither[T1]) ReaderIOEither[T.Tuple1[T1]] {
|
||||||
|
return G.SequenceT1[ReaderIOEither[T.Tuple1[T1]]](t1)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize2 converts a function with 2 parameters returning a tuple into a function with 2 parameters returning a [ReaderIOEither[R]]
|
// Eitherize2 converts a function with 2 parameters returning a tuple into a function with 2 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize2]
|
// The inverse function is [Uneitherize2]
|
||||||
func Eitherize2[F ~func(context.Context, T0, T1) (R, error), T0, T1, R any](f F) func(T0, T1) ReaderIOEither[R] {
|
func Eitherize2[F ~func(context.Context, T0, T1) (R, error), T0, T1, R any](f F) func(T0, T1) ReaderIOEither[R] {
|
||||||
return G.Eitherize2[ReaderIOEither[R]](f)
|
return G.Eitherize2[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT2 converts 2 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple2].
|
||||||
|
func SequenceT2[T1, T2 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2]) ReaderIOEither[T.Tuple2[T1, T2]] {
|
||||||
|
return G.SequenceT2[ReaderIOEither[T.Tuple2[T1, T2]]](t1, t2)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize3 converts a function with 3 parameters returning a tuple into a function with 3 parameters returning a [ReaderIOEither[R]]
|
// Eitherize3 converts a function with 3 parameters returning a tuple into a function with 3 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize3]
|
// The inverse function is [Uneitherize3]
|
||||||
func Eitherize3[F ~func(context.Context, T0, T1, T2) (R, error), T0, T1, T2, R any](f F) func(T0, T1, T2) ReaderIOEither[R] {
|
func Eitherize3[F ~func(context.Context, T0, T1, T2) (R, error), T0, T1, T2, R any](f F) func(T0, T1, T2) ReaderIOEither[R] {
|
||||||
return G.Eitherize3[ReaderIOEither[R]](f)
|
return G.Eitherize3[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT3 converts 3 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple3].
|
||||||
|
func SequenceT3[T1, T2, T3 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3]) ReaderIOEither[T.Tuple3[T1, T2, T3]] {
|
||||||
|
return G.SequenceT3[ReaderIOEither[T.Tuple3[T1, T2, T3]]](t1, t2, t3)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize4 converts a function with 4 parameters returning a tuple into a function with 4 parameters returning a [ReaderIOEither[R]]
|
// Eitherize4 converts a function with 4 parameters returning a tuple into a function with 4 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize4]
|
// The inverse function is [Uneitherize4]
|
||||||
func Eitherize4[F ~func(context.Context, T0, T1, T2, T3) (R, error), T0, T1, T2, T3, R any](f F) func(T0, T1, T2, T3) ReaderIOEither[R] {
|
func Eitherize4[F ~func(context.Context, T0, T1, T2, T3) (R, error), T0, T1, T2, T3, R any](f F) func(T0, T1, T2, T3) ReaderIOEither[R] {
|
||||||
return G.Eitherize4[ReaderIOEither[R]](f)
|
return G.Eitherize4[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT4 converts 4 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple4].
|
||||||
|
func SequenceT4[T1, T2, T3, T4 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4]) ReaderIOEither[T.Tuple4[T1, T2, T3, T4]] {
|
||||||
|
return G.SequenceT4[ReaderIOEither[T.Tuple4[T1, T2, T3, T4]]](t1, t2, t3, t4)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize5 converts a function with 5 parameters returning a tuple into a function with 5 parameters returning a [ReaderIOEither[R]]
|
// Eitherize5 converts a function with 5 parameters returning a tuple into a function with 5 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize5]
|
// The inverse function is [Uneitherize5]
|
||||||
func Eitherize5[F ~func(context.Context, T0, T1, T2, T3, T4) (R, error), T0, T1, T2, T3, T4, R any](f F) func(T0, T1, T2, T3, T4) ReaderIOEither[R] {
|
func Eitherize5[F ~func(context.Context, T0, T1, T2, T3, T4) (R, error), T0, T1, T2, T3, T4, R any](f F) func(T0, T1, T2, T3, T4) ReaderIOEither[R] {
|
||||||
return G.Eitherize5[ReaderIOEither[R]](f)
|
return G.Eitherize5[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT5 converts 5 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple5].
|
||||||
|
func SequenceT5[T1, T2, T3, T4, T5 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5]) ReaderIOEither[T.Tuple5[T1, T2, T3, T4, T5]] {
|
||||||
|
return G.SequenceT5[ReaderIOEither[T.Tuple5[T1, T2, T3, T4, T5]]](t1, t2, t3, t4, t5)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize6 converts a function with 6 parameters returning a tuple into a function with 6 parameters returning a [ReaderIOEither[R]]
|
// Eitherize6 converts a function with 6 parameters returning a tuple into a function with 6 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize6]
|
// The inverse function is [Uneitherize6]
|
||||||
func Eitherize6[F ~func(context.Context, T0, T1, T2, T3, T4, T5) (R, error), T0, T1, T2, T3, T4, T5, R any](f F) func(T0, T1, T2, T3, T4, T5) ReaderIOEither[R] {
|
func Eitherize6[F ~func(context.Context, T0, T1, T2, T3, T4, T5) (R, error), T0, T1, T2, T3, T4, T5, R any](f F) func(T0, T1, T2, T3, T4, T5) ReaderIOEither[R] {
|
||||||
return G.Eitherize6[ReaderIOEither[R]](f)
|
return G.Eitherize6[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT6 converts 6 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple6].
|
||||||
|
func SequenceT6[T1, T2, T3, T4, T5, T6 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5], t6 ReaderIOEither[T6]) ReaderIOEither[T.Tuple6[T1, T2, T3, T4, T5, T6]] {
|
||||||
|
return G.SequenceT6[ReaderIOEither[T.Tuple6[T1, T2, T3, T4, T5, T6]]](t1, t2, t3, t4, t5, t6)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize7 converts a function with 7 parameters returning a tuple into a function with 7 parameters returning a [ReaderIOEither[R]]
|
// Eitherize7 converts a function with 7 parameters returning a tuple into a function with 7 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize7]
|
// The inverse function is [Uneitherize7]
|
||||||
func Eitherize7[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6) (R, error), T0, T1, T2, T3, T4, T5, T6, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) ReaderIOEither[R] {
|
func Eitherize7[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6) (R, error), T0, T1, T2, T3, T4, T5, T6, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) ReaderIOEither[R] {
|
||||||
return G.Eitherize7[ReaderIOEither[R]](f)
|
return G.Eitherize7[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT7 converts 7 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple7].
|
||||||
|
func SequenceT7[T1, T2, T3, T4, T5, T6, T7 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5], t6 ReaderIOEither[T6], t7 ReaderIOEither[T7]) ReaderIOEither[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
|
||||||
|
return G.SequenceT7[ReaderIOEither[T.Tuple7[T1, T2, T3, T4, T5, T6, T7]]](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 [ReaderIOEither[R]]
|
// Eitherize8 converts a function with 8 parameters returning a tuple into a function with 8 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize8]
|
// The inverse function is [Uneitherize8]
|
||||||
func Eitherize8[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) ReaderIOEither[R] {
|
func Eitherize8[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) ReaderIOEither[R] {
|
||||||
return G.Eitherize8[ReaderIOEither[R]](f)
|
return G.Eitherize8[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT8 converts 8 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple8].
|
||||||
|
func SequenceT8[T1, T2, T3, T4, T5, T6, T7, T8 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5], t6 ReaderIOEither[T6], t7 ReaderIOEither[T7], t8 ReaderIOEither[T8]) ReaderIOEither[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
|
||||||
|
return G.SequenceT8[ReaderIOEither[T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]](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 [ReaderIOEither[R]]
|
// Eitherize9 converts a function with 9 parameters returning a tuple into a function with 9 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize9]
|
// The inverse function is [Uneitherize9]
|
||||||
func Eitherize9[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7, T8) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) ReaderIOEither[R] {
|
func Eitherize9[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7, T8) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) ReaderIOEither[R] {
|
||||||
return G.Eitherize9[ReaderIOEither[R]](f)
|
return G.Eitherize9[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT9 converts 9 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple9].
|
||||||
|
func SequenceT9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5], t6 ReaderIOEither[T6], t7 ReaderIOEither[T7], t8 ReaderIOEither[T8], t9 ReaderIOEither[T9]) ReaderIOEither[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
|
||||||
|
return G.SequenceT9[ReaderIOEither[T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]](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 [ReaderIOEither[R]]
|
// Eitherize10 converts a function with 10 parameters returning a tuple into a function with 10 parameters returning a [ReaderIOEither[R]]
|
||||||
// The inverse function is [Uneitherize10]
|
// The inverse function is [Uneitherize10]
|
||||||
func Eitherize10[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) ReaderIOEither[R] {
|
func Eitherize10[F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) (R, error), T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) ReaderIOEither[R] {
|
||||||
return G.Eitherize10[ReaderIOEither[R]](f)
|
return G.Eitherize10[ReaderIOEither[R]](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT10 converts 10 [ReaderIOEither] into a [ReaderIOEither] of a [T.Tuple10].
|
||||||
|
func SequenceT10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t1 ReaderIOEither[T1], t2 ReaderIOEither[T2], t3 ReaderIOEither[T3], t4 ReaderIOEither[T4], t5 ReaderIOEither[T5], t6 ReaderIOEither[T6], t7 ReaderIOEither[T7], t8 ReaderIOEither[T8], t9 ReaderIOEither[T9], t10 ReaderIOEither[T10]) ReaderIOEither[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
|
||||||
|
return G.SequenceT10[ReaderIOEither[T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]](t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
|
||||||
|
}
|
||||||
|
@ -2,13 +2,15 @@ package generic
|
|||||||
|
|
||||||
// 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
|
||||||
// 2023-07-19 16:18:34.1526819 +0200 CEST m=+0.012063601
|
// 2023-07-20 16:14:27.3155005 +0200 CEST m=+0.020795301
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
E "github.com/IBM/fp-go/either"
|
E "github.com/IBM/fp-go/either"
|
||||||
RE "github.com/IBM/fp-go/readerioeither/generic"
|
RE "github.com/IBM/fp-go/readerioeither/generic"
|
||||||
|
A "github.com/IBM/fp-go/internal/apply"
|
||||||
|
T "github.com/IBM/fp-go/tuple"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Eitherize0 converts a function with 0 parameters returning a tuple into a function with 0 parameters returning a [GRA]
|
// Eitherize0 converts a function with 0 parameters returning a tuple into a function with 0 parameters returning a [GRA]
|
||||||
@ -23,56 +25,476 @@ func Eitherize1[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0) (R
|
|||||||
return RE.Eitherize1[GRA](f)
|
return RE.Eitherize1[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT1 converts 1 readers into a reader of a [T.Tuple1].
|
||||||
|
func SequenceT1[
|
||||||
|
GR_TUPLE1 ~func(context.Context) GIO_TUPLE1,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GIO_TUPLE1 ~func() E.Either[error, T.Tuple1[T1]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
T1 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
) GR_TUPLE1 {
|
||||||
|
return A.SequenceT1(
|
||||||
|
Map[GR_T1, GR_TUPLE1, GIO_T1],
|
||||||
|
t1,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize2 converts a function with 2 parameters returning a tuple into a function with 2 parameters returning a [GRA]
|
// Eitherize2 converts a function with 2 parameters returning a tuple into a function with 2 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize2]
|
// The inverse function is [Uneitherize2]
|
||||||
func Eitherize2[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1) (R, error), GIOA ~func() E.Either[error, R], T0, T1, R any](f F) func(T0, T1) GRA {
|
func Eitherize2[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1) (R, error), GIOA ~func() E.Either[error, R], T0, T1, R any](f F) func(T0, T1) GRA {
|
||||||
return RE.Eitherize2[GRA](f)
|
return RE.Eitherize2[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT2 converts 2 readers into a reader of a [T.Tuple2].
|
||||||
|
func SequenceT2[
|
||||||
|
GR_TUPLE2 ~func(context.Context) GIO_TUPLE2,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GIO_TUPLE2 ~func() E.Either[error, T.Tuple2[T1, T2]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
T1,
|
||||||
|
T2 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
) GR_TUPLE2 {
|
||||||
|
return A.SequenceT2(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) T.Tuple2[T1, T2]], GIO_T1],
|
||||||
|
Ap[GR_TUPLE2, func(context.Context) func() E.Either[error, func(T2) T.Tuple2[T1, T2]], GR_T2],
|
||||||
|
t1,
|
||||||
|
t2,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize3 converts a function with 3 parameters returning a tuple into a function with 3 parameters returning a [GRA]
|
// Eitherize3 converts a function with 3 parameters returning a tuple into a function with 3 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize3]
|
// The inverse function is [Uneitherize3]
|
||||||
func Eitherize3[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, R any](f F) func(T0, T1, T2) GRA {
|
func Eitherize3[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, R any](f F) func(T0, T1, T2) GRA {
|
||||||
return RE.Eitherize3[GRA](f)
|
return RE.Eitherize3[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT3 converts 3 readers into a reader of a [T.Tuple3].
|
||||||
|
func SequenceT3[
|
||||||
|
GR_TUPLE3 ~func(context.Context) GIO_TUPLE3,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GIO_TUPLE3 ~func() E.Either[error, T.Tuple3[T1, T2, T3]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
) GR_TUPLE3 {
|
||||||
|
return A.SequenceT3(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) T.Tuple3[T1, T2, T3]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) T.Tuple3[T1, T2, T3]], func(context.Context) func() E.Either[error, func(T2) func(T3) T.Tuple3[T1, T2, T3]], GR_T2],
|
||||||
|
Ap[GR_TUPLE3, func(context.Context) func() E.Either[error, func(T3) T.Tuple3[T1, T2, T3]], GR_T3],
|
||||||
|
t1,
|
||||||
|
t2,
|
||||||
|
t3,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize4 converts a function with 4 parameters returning a tuple into a function with 4 parameters returning a [GRA]
|
// Eitherize4 converts a function with 4 parameters returning a tuple into a function with 4 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize4]
|
// The inverse function is [Uneitherize4]
|
||||||
func Eitherize4[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, R any](f F) func(T0, T1, T2, T3) GRA {
|
func Eitherize4[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, R any](f F) func(T0, T1, T2, T3) GRA {
|
||||||
return RE.Eitherize4[GRA](f)
|
return RE.Eitherize4[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT4 converts 4 readers into a reader of a [T.Tuple4].
|
||||||
|
func SequenceT4[
|
||||||
|
GR_TUPLE4 ~func(context.Context) GIO_TUPLE4,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GIO_TUPLE4 ~func() E.Either[error, T.Tuple4[T1, T2, T3, T4]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
) GR_TUPLE4 {
|
||||||
|
return A.SequenceT4(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) T.Tuple4[T1, T2, T3, T4]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) T.Tuple4[T1, T2, T3, T4]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) T.Tuple4[T1, T2, T3, T4]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) T.Tuple4[T1, T2, T3, T4]], func(context.Context) func() E.Either[error, func(T3) func(T4) T.Tuple4[T1, T2, T3, T4]], GR_T3],
|
||||||
|
Ap[GR_TUPLE4, func(context.Context) func() E.Either[error, func(T4) T.Tuple4[T1, T2, T3, T4]], GR_T4],
|
||||||
|
t1,
|
||||||
|
t2,
|
||||||
|
t3,
|
||||||
|
t4,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize5 converts a function with 5 parameters returning a tuple into a function with 5 parameters returning a [GRA]
|
// Eitherize5 converts a function with 5 parameters returning a tuple into a function with 5 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize5]
|
// The inverse function is [Uneitherize5]
|
||||||
func Eitherize5[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, R any](f F) func(T0, T1, T2, T3, T4) GRA {
|
func Eitherize5[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, R any](f F) func(T0, T1, T2, T3, T4) GRA {
|
||||||
return RE.Eitherize5[GRA](f)
|
return RE.Eitherize5[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT5 converts 5 readers into a reader of a [T.Tuple5].
|
||||||
|
func SequenceT5[
|
||||||
|
GR_TUPLE5 ~func(context.Context) GIO_TUPLE5,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GIO_TUPLE5 ~func() E.Either[error, T.Tuple5[T1, T2, T3, T4, T5]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
) GR_TUPLE5 {
|
||||||
|
return A.SequenceT5(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) T.Tuple5[T1, T2, T3, T4, T5]], func(context.Context) func() E.Either[error, func(T4) func(T5) T.Tuple5[T1, T2, T3, T4, T5]], GR_T4],
|
||||||
|
Ap[GR_TUPLE5, func(context.Context) func() E.Either[error, func(T5) T.Tuple5[T1, T2, T3, T4, T5]], GR_T5],
|
||||||
|
t1,
|
||||||
|
t2,
|
||||||
|
t3,
|
||||||
|
t4,
|
||||||
|
t5,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Eitherize6 converts a function with 6 parameters returning a tuple into a function with 6 parameters returning a [GRA]
|
// Eitherize6 converts a function with 6 parameters returning a tuple into a function with 6 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize6]
|
// The inverse function is [Uneitherize6]
|
||||||
func Eitherize6[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, R any](f F) func(T0, T1, T2, T3, T4, T5) GRA {
|
func Eitherize6[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, R any](f F) func(T0, T1, T2, T3, T4, T5) GRA {
|
||||||
return RE.Eitherize6[GRA](f)
|
return RE.Eitherize6[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT6 converts 6 readers into a reader of a [T.Tuple6].
|
||||||
|
func SequenceT6[
|
||||||
|
GR_TUPLE6 ~func(context.Context) GIO_TUPLE6,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GR_T6 ~func(context.Context) GIO_T6,
|
||||||
|
GIO_TUPLE6 ~func() E.Either[error, T.Tuple6[T1, T2, T3, T4, T5, T6]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
GIO_T6 ~func() E.Either[error, T6],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5,
|
||||||
|
T6 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
t6 GR_T6,
|
||||||
|
) GR_TUPLE6 {
|
||||||
|
return A.SequenceT6(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GR_T4],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], func(context.Context) func() E.Either[error, func(T5) func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GR_T5],
|
||||||
|
Ap[GR_TUPLE6, func(context.Context) func() E.Either[error, func(T6) T.Tuple6[T1, T2, T3, T4, T5, T6]], GR_T6],
|
||||||
|
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]
|
// Eitherize7 converts a function with 7 parameters returning a tuple into a function with 7 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize7]
|
// The inverse function is [Uneitherize7]
|
||||||
func Eitherize7[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) GRA {
|
func Eitherize7[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, R any](f F) func(T0, T1, T2, T3, T4, T5, T6) GRA {
|
||||||
return RE.Eitherize7[GRA](f)
|
return RE.Eitherize7[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT7 converts 7 readers into a reader of a [T.Tuple7].
|
||||||
|
func SequenceT7[
|
||||||
|
GR_TUPLE7 ~func(context.Context) GIO_TUPLE7,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GR_T6 ~func(context.Context) GIO_T6,
|
||||||
|
GR_T7 ~func(context.Context) GIO_T7,
|
||||||
|
GIO_TUPLE7 ~func() E.Either[error, T.Tuple7[T1, T2, T3, T4, T5, T6, T7]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
GIO_T6 ~func() E.Either[error, T6],
|
||||||
|
GIO_T7 ~func() E.Either[error, T7],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5,
|
||||||
|
T6,
|
||||||
|
T7 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
t6 GR_T6,
|
||||||
|
t7 GR_T7,
|
||||||
|
) GR_TUPLE7 {
|
||||||
|
return A.SequenceT7(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T4],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T5],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], func(context.Context) func() E.Either[error, func(T6) func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T6],
|
||||||
|
Ap[GR_TUPLE7, func(context.Context) func() E.Either[error, func(T7) T.Tuple7[T1, T2, T3, T4, T5, T6, T7]], GR_T7],
|
||||||
|
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]
|
// Eitherize8 converts a function with 8 parameters returning a tuple into a function with 8 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize8]
|
// The inverse function is [Uneitherize8]
|
||||||
func Eitherize8[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) GRA {
|
func Eitherize8[GRA ~func(context.Context) GIOA, F ~func(context.Context, T0, T1, T2, T3, T4, T5, T6, T7) (R, error), GIOA ~func() E.Either[error, R], T0, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7) GRA {
|
||||||
return RE.Eitherize8[GRA](f)
|
return RE.Eitherize8[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT8 converts 8 readers into a reader of a [T.Tuple8].
|
||||||
|
func SequenceT8[
|
||||||
|
GR_TUPLE8 ~func(context.Context) GIO_TUPLE8,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GR_T6 ~func(context.Context) GIO_T6,
|
||||||
|
GR_T7 ~func(context.Context) GIO_T7,
|
||||||
|
GR_T8 ~func(context.Context) GIO_T8,
|
||||||
|
GIO_TUPLE8 ~func() E.Either[error, T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
GIO_T6 ~func() E.Either[error, T6],
|
||||||
|
GIO_T7 ~func() E.Either[error, T7],
|
||||||
|
GIO_T8 ~func() E.Either[error, T8],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5,
|
||||||
|
T6,
|
||||||
|
T7,
|
||||||
|
T8 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
t6 GR_T6,
|
||||||
|
t7 GR_T7,
|
||||||
|
t8 GR_T8,
|
||||||
|
) GR_TUPLE8 {
|
||||||
|
return A.SequenceT8(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T4],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T5],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T6],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], func(context.Context) func() E.Either[error, func(T7) func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T7],
|
||||||
|
Ap[GR_TUPLE8, func(context.Context) func() E.Either[error, func(T8) T.Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]], GR_T8],
|
||||||
|
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]
|
// Eitherize9 converts a function with 9 parameters returning a tuple into a function with 9 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize9]
|
// The inverse function is [Uneitherize9]
|
||||||
func Eitherize9[GRA ~func(context.Context) GIOA, F ~func(context.Context, 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, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) GRA {
|
func Eitherize9[GRA ~func(context.Context) GIOA, F ~func(context.Context, 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, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8) GRA {
|
||||||
return RE.Eitherize9[GRA](f)
|
return RE.Eitherize9[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT9 converts 9 readers into a reader of a [T.Tuple9].
|
||||||
|
func SequenceT9[
|
||||||
|
GR_TUPLE9 ~func(context.Context) GIO_TUPLE9,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GR_T6 ~func(context.Context) GIO_T6,
|
||||||
|
GR_T7 ~func(context.Context) GIO_T7,
|
||||||
|
GR_T8 ~func(context.Context) GIO_T8,
|
||||||
|
GR_T9 ~func(context.Context) GIO_T9,
|
||||||
|
GIO_TUPLE9 ~func() E.Either[error, T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
GIO_T6 ~func() E.Either[error, T6],
|
||||||
|
GIO_T7 ~func() E.Either[error, T7],
|
||||||
|
GIO_T8 ~func() E.Either[error, T8],
|
||||||
|
GIO_T9 ~func() E.Either[error, T9],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5,
|
||||||
|
T6,
|
||||||
|
T7,
|
||||||
|
T8,
|
||||||
|
T9 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
t6 GR_T6,
|
||||||
|
t7 GR_T7,
|
||||||
|
t8 GR_T8,
|
||||||
|
t9 GR_T9,
|
||||||
|
) GR_TUPLE9 {
|
||||||
|
return A.SequenceT9(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T4],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T5],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T6],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T7) func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T7],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], func(context.Context) func() E.Either[error, func(T8) func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T8],
|
||||||
|
Ap[GR_TUPLE9, func(context.Context) func() E.Either[error, func(T9) T.Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]], GR_T9],
|
||||||
|
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]
|
// Eitherize10 converts a function with 10 parameters returning a tuple into a function with 10 parameters returning a [GRA]
|
||||||
// The inverse function is [Uneitherize10]
|
// The inverse function is [Uneitherize10]
|
||||||
func Eitherize10[GRA ~func(context.Context) GIOA, F ~func(context.Context, 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, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) GRA {
|
func Eitherize10[GRA ~func(context.Context) GIOA, F ~func(context.Context, 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, R any](f F) func(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) GRA {
|
||||||
return RE.Eitherize10[GRA](f)
|
return RE.Eitherize10[GRA](f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SequenceT10 converts 10 readers into a reader of a [T.Tuple10].
|
||||||
|
func SequenceT10[
|
||||||
|
GR_TUPLE10 ~func(context.Context) GIO_TUPLE10,
|
||||||
|
GR_T1 ~func(context.Context) GIO_T1,
|
||||||
|
GR_T2 ~func(context.Context) GIO_T2,
|
||||||
|
GR_T3 ~func(context.Context) GIO_T3,
|
||||||
|
GR_T4 ~func(context.Context) GIO_T4,
|
||||||
|
GR_T5 ~func(context.Context) GIO_T5,
|
||||||
|
GR_T6 ~func(context.Context) GIO_T6,
|
||||||
|
GR_T7 ~func(context.Context) GIO_T7,
|
||||||
|
GR_T8 ~func(context.Context) GIO_T8,
|
||||||
|
GR_T9 ~func(context.Context) GIO_T9,
|
||||||
|
GR_T10 ~func(context.Context) GIO_T10,
|
||||||
|
GIO_TUPLE10 ~func() E.Either[error, T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]],
|
||||||
|
GIO_T1 ~func() E.Either[error, T1],
|
||||||
|
GIO_T2 ~func() E.Either[error, T2],
|
||||||
|
GIO_T3 ~func() E.Either[error, T3],
|
||||||
|
GIO_T4 ~func() E.Either[error, T4],
|
||||||
|
GIO_T5 ~func() E.Either[error, T5],
|
||||||
|
GIO_T6 ~func() E.Either[error, T6],
|
||||||
|
GIO_T7 ~func() E.Either[error, T7],
|
||||||
|
GIO_T8 ~func() E.Either[error, T8],
|
||||||
|
GIO_T9 ~func() E.Either[error, T9],
|
||||||
|
GIO_T10 ~func() E.Either[error, T10],
|
||||||
|
T1,
|
||||||
|
T2,
|
||||||
|
T3,
|
||||||
|
T4,
|
||||||
|
T5,
|
||||||
|
T6,
|
||||||
|
T7,
|
||||||
|
T8,
|
||||||
|
T9,
|
||||||
|
T10 any](
|
||||||
|
t1 GR_T1,
|
||||||
|
t2 GR_T2,
|
||||||
|
t3 GR_T3,
|
||||||
|
t4 GR_T4,
|
||||||
|
t5 GR_T5,
|
||||||
|
t6 GR_T6,
|
||||||
|
t7 GR_T7,
|
||||||
|
t8 GR_T8,
|
||||||
|
t9 GR_T9,
|
||||||
|
t10 GR_T10,
|
||||||
|
) GR_TUPLE10 {
|
||||||
|
return A.SequenceT10(
|
||||||
|
Map[GR_T1, func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GIO_T1],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T2) func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T2],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T3) func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T3],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T4) func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T4],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T5) func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T5],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T6) func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T6],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T7) func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T7],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T8) func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T8],
|
||||||
|
Ap[func(context.Context) func() E.Either[error, func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], func(context.Context) func() E.Either[error, func(T9) func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T9],
|
||||||
|
Ap[GR_TUPLE10, func(context.Context) func() E.Either[error, func(T10) T.Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]], GR_T10],
|
||||||
|
t1,
|
||||||
|
t2,
|
||||||
|
t3,
|
||||||
|
t4,
|
||||||
|
t5,
|
||||||
|
t6,
|
||||||
|
t7,
|
||||||
|
t8,
|
||||||
|
t9,
|
||||||
|
t10,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
@ -1,85 +0,0 @@
|
|||||||
package generic
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
E "github.com/IBM/fp-go/either"
|
|
||||||
RE "github.com/IBM/fp-go/readerioeither/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[
|
|
||||||
GRT ~func(context.Context) GIOT,
|
|
||||||
GRA ~func(context.Context) GIOA,
|
|
||||||
|
|
||||||
GIOA ~func() E.Either[error, A],
|
|
||||||
GIOT ~func() E.Either[error, T.Tuple1[A]],
|
|
||||||
|
|
||||||
A any](a GRA) GRT {
|
|
||||||
return RE.SequenceT1[
|
|
||||||
GRA,
|
|
||||||
GRT,
|
|
||||||
](a)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT2[
|
|
||||||
GRT ~func(context.Context) GIOT,
|
|
||||||
GRA ~func(context.Context) GIOA,
|
|
||||||
GRB ~func(context.Context) GIOB,
|
|
||||||
|
|
||||||
GIOA ~func() E.Either[error, A],
|
|
||||||
GIOB ~func() E.Either[error, B],
|
|
||||||
GIOT ~func() E.Either[error, T.Tuple2[A, B]],
|
|
||||||
|
|
||||||
A, B any](a GRA, b GRB) GRT {
|
|
||||||
return RE.SequenceT2[
|
|
||||||
GRA,
|
|
||||||
GRB,
|
|
||||||
GRT,
|
|
||||||
](a, b)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT3[
|
|
||||||
GRT ~func(context.Context) GIOT,
|
|
||||||
GRA ~func(context.Context) GIOA,
|
|
||||||
GRB ~func(context.Context) GIOB,
|
|
||||||
GRC ~func(context.Context) GIOC,
|
|
||||||
|
|
||||||
GIOA ~func() E.Either[error, A],
|
|
||||||
GIOB ~func() E.Either[error, B],
|
|
||||||
GIOC ~func() E.Either[error, C],
|
|
||||||
GIOT ~func() E.Either[error, T.Tuple3[A, B, C]],
|
|
||||||
|
|
||||||
A, B, C any](a GRA, b GRB, c GRC) GRT {
|
|
||||||
return RE.SequenceT3[
|
|
||||||
GRA,
|
|
||||||
GRB,
|
|
||||||
GRC,
|
|
||||||
GRT,
|
|
||||||
](a, b, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT4[
|
|
||||||
GRT ~func(context.Context) GIOT,
|
|
||||||
GRA ~func(context.Context) GIOA,
|
|
||||||
GRB ~func(context.Context) GIOB,
|
|
||||||
GRC ~func(context.Context) GIOC,
|
|
||||||
GRD ~func(context.Context) GIOD,
|
|
||||||
|
|
||||||
GIOA ~func() E.Either[error, A],
|
|
||||||
GIOB ~func() E.Either[error, B],
|
|
||||||
GIOC ~func() E.Either[error, C],
|
|
||||||
GIOD ~func() E.Either[error, D],
|
|
||||||
GIOT ~func() E.Either[error, T.Tuple4[A, B, C, D]],
|
|
||||||
|
|
||||||
A, B, C, D any](a GRA, b GRB, c GRC, d GRD) GRT {
|
|
||||||
return RE.SequenceT4[
|
|
||||||
GRA,
|
|
||||||
GRB,
|
|
||||||
GRC,
|
|
||||||
GRD,
|
|
||||||
GRT,
|
|
||||||
](a, b, c, d)
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
package readerioeither
|
|
||||||
|
|
||||||
import (
|
|
||||||
G "github.com/IBM/fp-go/context/readerioeither/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 ReaderIOEither[A]) ReaderIOEither[T.Tuple1[A]] {
|
|
||||||
return G.SequenceT1[ReaderIOEither[T.Tuple1[A]]](a)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT2[A, B any](a ReaderIOEither[A], b ReaderIOEither[B]) ReaderIOEither[T.Tuple2[A, B]] {
|
|
||||||
return G.SequenceT2[ReaderIOEither[T.Tuple2[A, B]]](a, b)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT3[A, B, C any](a ReaderIOEither[A], b ReaderIOEither[B], c ReaderIOEither[C]) ReaderIOEither[T.Tuple3[A, B, C]] {
|
|
||||||
return G.SequenceT3[ReaderIOEither[T.Tuple3[A, B, C]]](a, b, c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SequenceT4[A, B, C, D any](a ReaderIOEither[A], b ReaderIOEither[B], c ReaderIOEither[C], d ReaderIOEither[D]) ReaderIOEither[T.Tuple4[A, B, C, D]] {
|
|
||||||
return G.SequenceT4[ReaderIOEither[T.Tuple4[A, B, C, D]]](a, b, c, d)
|
|
||||||
}
|
|
@ -1,4 +1,18 @@
|
|||||||
// Package readerioeither implements a specialization of the Reader monad assuming a golang context as the context of the monad and a standard golang error
|
// 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 readerioeither
|
package readerioeither
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:36.5482933 +0200 CEST m=+0.013837701
|
// 2023-07-20 16:14:28.8955293 +0200 CEST m=+0.018988301
|
||||||
package either
|
package either
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
A "github.com/IBM/fp-go/internal/apply"
|
A "github.com/IBM/fp-go/internal/apply"
|
||||||
T "github.com/IBM/fp-go/tuple"
|
T "github.com/IBM/fp-go/tuple"
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:40.5224382 +0200 CEST m=+0.122863501
|
// 2023-07-20 16:14:35.0470953 +0200 CEST m=+0.022083401
|
||||||
package function
|
package function
|
||||||
|
|
||||||
// Combinations for a total of 1 arguments
|
// Combinations for a total of 1 arguments
|
||||||
|
|
||||||
// Bind1of1 takes a function with 1 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
// Bind1of1 takes a function with 1 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
||||||
@ -21,7 +20,6 @@ func Ignore1of1[T1 any, F ~func() R, R any](f F) func(T1) R {
|
|||||||
return f()
|
return f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combinations for a total of 2 arguments
|
// Combinations for a total of 2 arguments
|
||||||
|
|
||||||
// Bind1of2 takes a function with 2 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
// Bind1of2 takes a function with 2 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
||||||
@ -74,7 +72,6 @@ func Ignore12of2[T1, T2 any, F ~func() R, R any](f F) func(T1, T2) R {
|
|||||||
return f()
|
return f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combinations for a total of 3 arguments
|
// Combinations for a total of 3 arguments
|
||||||
|
|
||||||
// Bind1of3 takes a function with 3 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
// Bind1of3 takes a function with 3 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
||||||
@ -195,7 +192,6 @@ func Ignore123of3[T1, T2, T3 any, F ~func() R, R any](f F) func(T1, T2, T3) R {
|
|||||||
return f()
|
return f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combinations for a total of 4 arguments
|
// Combinations for a total of 4 arguments
|
||||||
|
|
||||||
// Bind1of4 takes a function with 4 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
// Bind1of4 takes a function with 4 parameters and returns a new function with 1 parameters that will bind these parameters to the positions [1] of the original function.
|
||||||
|
@ -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
|
||||||
// 2023-07-19 16:18:38.55937 +0200 CEST m=+0.097297601
|
// 2023-07-20 16:14:30.549415 +0200 CEST m=+0.067044301
|
||||||
package function
|
package function
|
||||||
|
|
||||||
// Pipe0 takes an initial value t0 and successively applies 0 functions where the input of a function is the return value of the previous function
|
// Pipe0 takes an initial value t0 and successively applies 0 functions where the input of a function is the return value of the previous function
|
||||||
@ -15,14 +15,12 @@ func Variadic0[V, R any](f func([]V) R) func(...V) R {
|
|||||||
return f(v)
|
return f(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic0 converts a function taking 0 parameters and a final variadic argument into a function with 0 parameters but a final slice argument
|
// Unvariadic0 converts a function taking 0 parameters and a final variadic argument into a function with 0 parameters but a final slice argument
|
||||||
func Unvariadic0[V, R any](f func(...V) R) func([]V) R {
|
func Unvariadic0[V, R any](f func(...V) R) func([]V) R {
|
||||||
return func(v []V) R {
|
return func(v []V) R {
|
||||||
return f(v...)
|
return f(v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe1 takes an initial value t0 and successively applies 1 functions where the input of a function is the return value of the previous function
|
// Pipe1 takes an initial value t0 and successively applies 1 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe1[F1 ~func(T0) T1, T0, T1 any](t0 T0, f1 F1) T1 {
|
func Pipe1[F1 ~func(T0) T1, T0, T1 any](t0 T0, f1 F1) T1 {
|
||||||
@ -67,14 +65,12 @@ func Variadic1[T1, V, R any](f func(T1, []V) R) func(T1, ...V) R {
|
|||||||
return f(t1, v)
|
return f(t1, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic1 converts a function taking 1 parameters and a final variadic argument into a function with 1 parameters but a final slice argument
|
// Unvariadic1 converts a function taking 1 parameters and a final variadic argument into a function with 1 parameters but a final slice argument
|
||||||
func Unvariadic1[T1, V, R any](f func(T1, ...V) R) func(T1, []V) R {
|
func Unvariadic1[T1, V, R any](f func(T1, ...V) R) func(T1, []V) R {
|
||||||
return func(t1 T1, v []V) R {
|
return func(t1 T1, v []V) R {
|
||||||
return f(t1, v...)
|
return f(t1, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe2 takes an initial value t0 and successively applies 2 functions where the input of a function is the return value of the previous function
|
// Pipe2 takes an initial value t0 and successively applies 2 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe2[F1 ~func(T0) T1, F2 ~func(T1) T2, T0, T1, T2 any](t0 T0, f1 F1, f2 F2) T2 {
|
func Pipe2[F1 ~func(T0) T1, F2 ~func(T1) T2, T0, T1, T2 any](t0 T0, f1 F1, f2 F2) T2 {
|
||||||
@ -122,14 +118,12 @@ func Variadic2[T1, T2, V, R any](f func(T1, T2, []V) R) func(T1, T2, ...V) R {
|
|||||||
return f(t1, t2, v)
|
return f(t1, t2, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic2 converts a function taking 2 parameters and a final variadic argument into a function with 2 parameters but a final slice argument
|
// Unvariadic2 converts a function taking 2 parameters and a final variadic argument into a function with 2 parameters but a final slice argument
|
||||||
func Unvariadic2[T1, T2, V, R any](f func(T1, T2, ...V) R) func(T1, T2, []V) R {
|
func Unvariadic2[T1, T2, V, R any](f func(T1, T2, ...V) R) func(T1, T2, []V) R {
|
||||||
return func(t1 T1, t2 T2, v []V) R {
|
return func(t1 T1, t2 T2, v []V) R {
|
||||||
return f(t1, t2, v...)
|
return f(t1, t2, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe3 takes an initial value t0 and successively applies 3 functions where the input of a function is the return value of the previous function
|
// Pipe3 takes an initial value t0 and successively applies 3 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe3[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, T0, T1, T2, T3 any](t0 T0, f1 F1, f2 F2, f3 F3) T3 {
|
func Pipe3[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, T0, T1, T2, T3 any](t0 T0, f1 F1, f2 F2, f3 F3) T3 {
|
||||||
@ -180,14 +174,12 @@ func Variadic3[T1, T2, T3, V, R any](f func(T1, T2, T3, []V) R) func(T1, T2, T3,
|
|||||||
return f(t1, t2, t3, v)
|
return f(t1, t2, t3, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic3 converts a function taking 3 parameters and a final variadic argument into a function with 3 parameters but a final slice argument
|
// Unvariadic3 converts a function taking 3 parameters and a final variadic argument into a function with 3 parameters but a final slice argument
|
||||||
func Unvariadic3[T1, T2, T3, V, R any](f func(T1, T2, T3, ...V) R) func(T1, T2, T3, []V) R {
|
func Unvariadic3[T1, T2, T3, V, R any](f func(T1, T2, T3, ...V) R) func(T1, T2, T3, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, v []V) R {
|
||||||
return f(t1, t2, t3, v...)
|
return f(t1, t2, t3, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe4 takes an initial value t0 and successively applies 4 functions where the input of a function is the return value of the previous function
|
// Pipe4 takes an initial value t0 and successively applies 4 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe4[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, T0, T1, T2, T3, T4 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4) T4 {
|
func Pipe4[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, T0, T1, T2, T3, T4 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4) T4 {
|
||||||
@ -241,14 +233,12 @@ func Variadic4[T1, T2, T3, T4, V, R any](f func(T1, T2, T3, T4, []V) R) func(T1,
|
|||||||
return f(t1, t2, t3, t4, v)
|
return f(t1, t2, t3, t4, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic4 converts a function taking 4 parameters and a final variadic argument into a function with 4 parameters but a final slice argument
|
// Unvariadic4 converts a function taking 4 parameters and a final variadic argument into a function with 4 parameters but a final slice argument
|
||||||
func Unvariadic4[T1, T2, T3, T4, V, R any](f func(T1, T2, T3, T4, ...V) R) func(T1, T2, T3, T4, []V) R {
|
func Unvariadic4[T1, T2, T3, T4, V, R any](f func(T1, T2, T3, T4, ...V) R) func(T1, T2, T3, T4, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, v []V) R {
|
||||||
return f(t1, t2, t3, t4, v...)
|
return f(t1, t2, t3, t4, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe5 takes an initial value t0 and successively applies 5 functions where the input of a function is the return value of the previous function
|
// Pipe5 takes an initial value t0 and successively applies 5 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe5[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, T0, T1, T2, T3, T4, T5 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) T5 {
|
func Pipe5[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, T0, T1, T2, T3, T4, T5 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) T5 {
|
||||||
@ -305,14 +295,12 @@ func Variadic5[T1, T2, T3, T4, T5, V, R any](f func(T1, T2, T3, T4, T5, []V) R)
|
|||||||
return f(t1, t2, t3, t4, t5, v)
|
return f(t1, t2, t3, t4, t5, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic5 converts a function taking 5 parameters and a final variadic argument into a function with 5 parameters but a final slice argument
|
// Unvariadic5 converts a function taking 5 parameters and a final variadic argument into a function with 5 parameters but a final slice argument
|
||||||
func Unvariadic5[T1, T2, T3, T4, T5, V, R any](f func(T1, T2, T3, T4, T5, ...V) R) func(T1, T2, T3, T4, T5, []V) R {
|
func Unvariadic5[T1, T2, T3, T4, T5, V, R any](f func(T1, T2, T3, T4, T5, ...V) R) func(T1, T2, T3, T4, T5, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, v...)
|
return f(t1, t2, t3, t4, t5, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe6 takes an initial value t0 and successively applies 6 functions where the input of a function is the return value of the previous function
|
// Pipe6 takes an initial value t0 and successively applies 6 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe6[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, T0, T1, T2, T3, T4, T5, T6 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) T6 {
|
func Pipe6[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, T0, T1, T2, T3, T4, T5, T6 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) T6 {
|
||||||
@ -372,14 +360,12 @@ func Variadic6[T1, T2, T3, T4, T5, T6, V, R any](f func(T1, T2, T3, T4, T5, T6,
|
|||||||
return f(t1, t2, t3, t4, t5, t6, v)
|
return f(t1, t2, t3, t4, t5, t6, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic6 converts a function taking 6 parameters and a final variadic argument into a function with 6 parameters but a final slice argument
|
// Unvariadic6 converts a function taking 6 parameters and a final variadic argument into a function with 6 parameters but a final slice argument
|
||||||
func Unvariadic6[T1, T2, T3, T4, T5, T6, V, R any](f func(T1, T2, T3, T4, T5, T6, ...V) R) func(T1, T2, T3, T4, T5, T6, []V) R {
|
func Unvariadic6[T1, T2, T3, T4, T5, T6, V, R any](f func(T1, T2, T3, T4, T5, T6, ...V) R) func(T1, T2, T3, T4, T5, T6, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, v...)
|
return f(t1, t2, t3, t4, t5, t6, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe7 takes an initial value t0 and successively applies 7 functions where the input of a function is the return value of the previous function
|
// Pipe7 takes an initial value t0 and successively applies 7 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe7[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, T0, T1, T2, T3, T4, T5, T6, T7 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) T7 {
|
func Pipe7[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, T0, T1, T2, T3, T4, T5, T6, T7 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) T7 {
|
||||||
@ -442,14 +428,12 @@ func Variadic7[T1, T2, T3, T4, T5, T6, T7, V, R any](f func(T1, T2, T3, T4, T5,
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic7 converts a function taking 7 parameters and a final variadic argument into a function with 7 parameters but a final slice argument
|
// Unvariadic7 converts a function taking 7 parameters and a final variadic argument into a function with 7 parameters but a final slice argument
|
||||||
func Unvariadic7[T1, T2, T3, T4, T5, T6, T7, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, []V) R {
|
func Unvariadic7[T1, T2, T3, T4, T5, T6, T7, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe8 takes an initial value t0 and successively applies 8 functions where the input of a function is the return value of the previous function
|
// Pipe8 takes an initial value t0 and successively applies 8 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe8[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, T0, T1, T2, T3, T4, T5, T6, T7, T8 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) T8 {
|
func Pipe8[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, T0, T1, T2, T3, T4, T5, T6, T7, T8 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) T8 {
|
||||||
@ -515,14 +499,12 @@ func Variadic8[T1, T2, T3, T4, T5, T6, T7, T8, V, R any](f func(T1, T2, T3, T4,
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic8 converts a function taking 8 parameters and a final variadic argument into a function with 8 parameters but a final slice argument
|
// Unvariadic8 converts a function taking 8 parameters and a final variadic argument into a function with 8 parameters but a final slice argument
|
||||||
func Unvariadic8[T1, T2, T3, T4, T5, T6, T7, T8, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, []V) R {
|
func Unvariadic8[T1, T2, T3, T4, T5, T6, T7, T8, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe9 takes an initial value t0 and successively applies 9 functions where the input of a function is the return value of the previous function
|
// Pipe9 takes an initial value t0 and successively applies 9 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe9[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) T9 {
|
func Pipe9[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) T9 {
|
||||||
@ -591,14 +573,12 @@ func Variadic9[T1, T2, T3, T4, T5, T6, T7, T8, T9, V, R any](f func(T1, T2, T3,
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic9 converts a function taking 9 parameters and a final variadic argument into a function with 9 parameters but a final slice argument
|
// Unvariadic9 converts a function taking 9 parameters and a final variadic argument into a function with 9 parameters but a final slice argument
|
||||||
func Unvariadic9[T1, T2, T3, T4, T5, T6, T7, T8, T9, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, []V) R {
|
func Unvariadic9[T1, T2, T3, T4, T5, T6, T7, T8, T9, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe10 takes an initial value t0 and successively applies 10 functions where the input of a function is the return value of the previous function
|
// Pipe10 takes an initial value t0 and successively applies 10 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe10[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) T10 {
|
func Pipe10[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) T10 {
|
||||||
@ -670,14 +650,12 @@ func Variadic10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, V, R any](f func(T1, T2
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic10 converts a function taking 10 parameters and a final variadic argument into a function with 10 parameters but a final slice argument
|
// Unvariadic10 converts a function taking 10 parameters and a final variadic argument into a function with 10 parameters but a final slice argument
|
||||||
func Unvariadic10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, []V) R {
|
func Unvariadic10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe11 takes an initial value t0 and successively applies 11 functions where the input of a function is the return value of the previous function
|
// Pipe11 takes an initial value t0 and successively applies 11 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe11[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11) T11 {
|
func Pipe11[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11) T11 {
|
||||||
@ -752,14 +730,12 @@ func Variadic11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, V, R any](f func(T
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic11 converts a function taking 11 parameters and a final variadic argument into a function with 11 parameters but a final slice argument
|
// Unvariadic11 converts a function taking 11 parameters and a final variadic argument into a function with 11 parameters but a final slice argument
|
||||||
func Unvariadic11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, []V) R {
|
func Unvariadic11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe12 takes an initial value t0 and successively applies 12 functions where the input of a function is the return value of the previous function
|
// Pipe12 takes an initial value t0 and successively applies 12 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe12[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12) T12 {
|
func Pipe12[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12) T12 {
|
||||||
@ -837,14 +813,12 @@ func Variadic12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, V, R any](f f
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic12 converts a function taking 12 parameters and a final variadic argument into a function with 12 parameters but a final slice argument
|
// Unvariadic12 converts a function taking 12 parameters and a final variadic argument into a function with 12 parameters but a final slice argument
|
||||||
func Unvariadic12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, []V) R {
|
func Unvariadic12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe13 takes an initial value t0 and successively applies 13 functions where the input of a function is the return value of the previous function
|
// Pipe13 takes an initial value t0 and successively applies 13 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe13[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13) T13 {
|
func Pipe13[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13) T13 {
|
||||||
@ -925,14 +899,12 @@ func Variadic13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, V, R any
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic13 converts a function taking 13 parameters and a final variadic argument into a function with 13 parameters but a final slice argument
|
// Unvariadic13 converts a function taking 13 parameters and a final variadic argument into a function with 13 parameters but a final slice argument
|
||||||
func Unvariadic13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, []V) R {
|
func Unvariadic13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe14 takes an initial value t0 and successively applies 14 functions where the input of a function is the return value of the previous function
|
// Pipe14 takes an initial value t0 and successively applies 14 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe14[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14) T14 {
|
func Pipe14[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14) T14 {
|
||||||
@ -1016,14 +988,12 @@ func Variadic14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, V,
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic14 converts a function taking 14 parameters and a final variadic argument into a function with 14 parameters but a final slice argument
|
// Unvariadic14 converts a function taking 14 parameters and a final variadic argument into a function with 14 parameters but a final slice argument
|
||||||
func Unvariadic14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, []V) R {
|
func Unvariadic14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe15 takes an initial value t0 and successively applies 15 functions where the input of a function is the return value of the previous function
|
// Pipe15 takes an initial value t0 and successively applies 15 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe15[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15) T15 {
|
func Pipe15[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15) T15 {
|
||||||
@ -1110,14 +1080,12 @@ func Variadic15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic15 converts a function taking 15 parameters and a final variadic argument into a function with 15 parameters but a final slice argument
|
// Unvariadic15 converts a function taking 15 parameters and a final variadic argument into a function with 15 parameters but a final slice argument
|
||||||
func Unvariadic15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, []V) R {
|
func Unvariadic15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe16 takes an initial value t0 and successively applies 16 functions where the input of a function is the return value of the previous function
|
// Pipe16 takes an initial value t0 and successively applies 16 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe16[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16) T16 {
|
func Pipe16[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16) T16 {
|
||||||
@ -1207,14 +1175,12 @@ func Variadic16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic16 converts a function taking 16 parameters and a final variadic argument into a function with 16 parameters but a final slice argument
|
// Unvariadic16 converts a function taking 16 parameters and a final variadic argument into a function with 16 parameters but a final slice argument
|
||||||
func Unvariadic16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, []V) R {
|
func Unvariadic16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe17 takes an initial value t0 and successively applies 17 functions where the input of a function is the return value of the previous function
|
// Pipe17 takes an initial value t0 and successively applies 17 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe17[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17) T17 {
|
func Pipe17[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17) T17 {
|
||||||
@ -1307,14 +1273,12 @@ func Variadic17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic17 converts a function taking 17 parameters and a final variadic argument into a function with 17 parameters but a final slice argument
|
// Unvariadic17 converts a function taking 17 parameters and a final variadic argument into a function with 17 parameters but a final slice argument
|
||||||
func Unvariadic17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, []V) R {
|
func Unvariadic17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe18 takes an initial value t0 and successively applies 18 functions where the input of a function is the return value of the previous function
|
// Pipe18 takes an initial value t0 and successively applies 18 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe18[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18) T18 {
|
func Pipe18[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18) T18 {
|
||||||
@ -1410,14 +1374,12 @@ func Variadic18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic18 converts a function taking 18 parameters and a final variadic argument into a function with 18 parameters but a final slice argument
|
// Unvariadic18 converts a function taking 18 parameters and a final variadic argument into a function with 18 parameters but a final slice argument
|
||||||
func Unvariadic18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, []V) R {
|
func Unvariadic18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe19 takes an initial value t0 and successively applies 19 functions where the input of a function is the return value of the previous function
|
// Pipe19 takes an initial value t0 and successively applies 19 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe19[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, F19 ~func(T18) T19, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18, f19 F19) T19 {
|
func Pipe19[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, F19 ~func(T18) T19, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18, f19 F19) T19 {
|
||||||
@ -1516,14 +1478,12 @@ func Variadic19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic19 converts a function taking 19 parameters and a final variadic argument into a function with 19 parameters but a final slice argument
|
// Unvariadic19 converts a function taking 19 parameters and a final variadic argument into a function with 19 parameters but a final slice argument
|
||||||
func Unvariadic19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, []V) R {
|
func Unvariadic19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, t19 T19, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, t19 T19, v []V) R {
|
||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, v...)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, v...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pipe20 takes an initial value t0 and successively applies 20 functions where the input of a function is the return value of the previous function
|
// Pipe20 takes an initial value t0 and successively applies 20 functions where the input of a function is the return value of the previous function
|
||||||
// The final return value is the result of the last function application
|
// The final return value is the result of the last function application
|
||||||
func Pipe20[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, F19 ~func(T18) T19, F20 ~func(T19) T20, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18, f19 F19, f20 F20) T20 {
|
func Pipe20[F1 ~func(T0) T1, F2 ~func(T1) T2, F3 ~func(T2) T3, F4 ~func(T3) T4, F5 ~func(T4) T5, F6 ~func(T5) T6, F7 ~func(T6) T7, F8 ~func(T7) T8, F9 ~func(T8) T9, F10 ~func(T9) T10, F11 ~func(T10) T11, F12 ~func(T11) T12, F13 ~func(T12) T13, F14 ~func(T13) T14, F15 ~func(T14) T15, F16 ~func(T15) T16, F17 ~func(T16) T17, F18 ~func(T17) T18, F19 ~func(T18) T19, F20 ~func(T19) T20, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20 any](t0 T0, f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10, f11 F11, f12 F12, f13 F13, f14 F14, f15 F15, f16 F16, f17 F17, f18 F18, f19 F19, f20 F20) T20 {
|
||||||
@ -1625,7 +1585,6 @@ func Variadic20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15
|
|||||||
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, v)
|
return f(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unvariadic20 converts a function taking 20 parameters and a final variadic argument into a function with 20 parameters but a final slice argument
|
// Unvariadic20 converts a function taking 20 parameters and a final variadic argument into a function with 20 parameters but a final slice argument
|
||||||
func Unvariadic20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, []V) R {
|
func Unvariadic20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, V, R any](f func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, ...V) R) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, []V) R {
|
||||||
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, t19 T19, t20 T20, v []V) R {
|
return func(t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10, t11 T11, t12 T12, t13 T13, t14 T14, t15 T15, t16 T16, t17 T17, t18 T18, t19 T19, t20 T20, v []V) R {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:43.8898665 +0200 CEST m=+0.018620401
|
// 2023-07-20 16:14:38.2378673 +0200 CEST m=+0.054938201
|
||||||
package identity
|
package identity
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
A "github.com/IBM/fp-go/internal/apply"
|
A "github.com/IBM/fp-go/internal/apply"
|
||||||
T "github.com/IBM/fp-go/tuple"
|
T "github.com/IBM/fp-go/tuple"
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:46.6106006 +0200 CEST m=+0.058609201
|
// 2023-07-20 16:14:40.4020781 +0200 CEST m=+0.037015301
|
||||||
package apply
|
package apply
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
F "github.com/IBM/fp-go/function"
|
F "github.com/IBM/fp-go/function"
|
||||||
T "github.com/IBM/fp-go/tuple"
|
T "github.com/IBM/fp-go/tuple"
|
||||||
|
17
main.go
17
main.go
@ -1,4 +1,19 @@
|
|||||||
// Package main
|
// 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 main contains the entry point for the code generator
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:50.0533497 +0200 CEST m=+0.019645401
|
// 2023-07-20 16:14:43.2805352 +0200 CEST m=+0.019400701
|
||||||
package option
|
package option
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
A "github.com/IBM/fp-go/internal/apply"
|
A "github.com/IBM/fp-go/internal/apply"
|
||||||
T "github.com/IBM/fp-go/tuple"
|
T "github.com/IBM/fp-go/tuple"
|
||||||
)
|
)
|
||||||
|
|
||||||
// optionize converts a nullary function to an option
|
// optionize converts a nullary function to an option
|
||||||
func optionize[R any](f func() (R, bool)) Option[R] {
|
func optionize[R any](f func() (R, bool)) Option[R] {
|
||||||
if r, ok := f(); ok {
|
if r, ok := f(); ok {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:52.5144916 +0200 CEST m=+0.241563101
|
// 2023-07-20 16:14:46.7504208 +0200 CEST m=+0.095418801
|
||||||
package reader
|
package reader
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
G "github.com/IBM/fp-go/reader/generic"
|
G "github.com/IBM/fp-go/reader/generic"
|
||||||
)
|
)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:52.5450262 +0200 CEST m=+0.272097701
|
// 2023-07-20 16:14:46.7514193 +0200 CEST m=+0.096417301
|
||||||
package generic
|
package generic
|
||||||
|
|
||||||
|
|
||||||
// From0 converts a function with 1 parameters returning a [R] into a function with 0 parameters returning a [GRA]
|
// From0 converts a function with 1 parameters returning a [R] into a function with 0 parameters returning a [GRA]
|
||||||
// The first parameter is considered to be the context [C].
|
// The first parameter is considered to be the context [C].
|
||||||
func From0[GRA ~func(C) R, F ~func(C) R, C, R any](f F) func() GRA {
|
func From0[GRA ~func(C) R, F ~func(C) R, C, R any](f F) func() GRA {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:55.4405883 +0200 CEST m=+0.019120301
|
// 2023-07-20 16:14:48.8807201 +0200 CEST m=+0.044278401
|
||||||
package readerioeither
|
package readerioeither
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
G "github.com/IBM/fp-go/readerioeither/generic"
|
G "github.com/IBM/fp-go/readerioeither/generic"
|
||||||
)
|
)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:55.4415885 +0200 CEST m=+0.020120501
|
// 2023-07-20 16:14:48.8823313 +0200 CEST m=+0.045889601
|
||||||
package generic
|
package generic
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
E "github.com/IBM/fp-go/either"
|
E "github.com/IBM/fp-go/either"
|
||||||
RD "github.com/IBM/fp-go/reader/generic"
|
RD "github.com/IBM/fp-go/reader/generic"
|
||||||
@ -22,8 +23,7 @@ func Eitherize0[GRA ~func(C) GIOA, F ~func(C) (R, error), GIOA ~func() E.Either[
|
|||||||
return From0[GRA](func(r C) func() (R, error) {
|
return From0[GRA](func(r C) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r)
|
return f(r)
|
||||||
}
|
}})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// From1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [GRA]
|
// From1 converts a function with 2 parameters returning a tuple into a function with 1 parameters returning a [GRA]
|
||||||
@ -40,8 +40,7 @@ func Eitherize1[GRA ~func(C) GIOA, F ~func(C, T0) (R, error), GIOA ~func() E.Eit
|
|||||||
return From1[GRA](func(r C, t0 T0) func() (R, error) {
|
return From1[GRA](func(r C, t0 T0) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r, t0)
|
return f(r, t0)
|
||||||
}
|
}})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// From2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [GRA]
|
// From2 converts a function with 3 parameters returning a tuple into a function with 2 parameters returning a [GRA]
|
||||||
@ -58,8 +57,7 @@ func Eitherize2[GRA ~func(C) GIOA, F ~func(C, T0, T1) (R, error), GIOA ~func() E
|
|||||||
return From2[GRA](func(r C, t0 T0, t1 T1) func() (R, error) {
|
return From2[GRA](func(r C, t0 T0, t1 T1) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r, t0, t1)
|
return f(r, t0, t1)
|
||||||
}
|
}})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// From3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [GRA]
|
// From3 converts a function with 4 parameters returning a tuple into a function with 3 parameters returning a [GRA]
|
||||||
@ -76,8 +74,7 @@ func Eitherize3[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2) (R, error), GIOA ~func
|
|||||||
return From3[GRA](func(r C, t0 T0, t1 T1, t2 T2) func() (R, error) {
|
return From3[GRA](func(r C, t0 T0, t1 T1, t2 T2) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r, t0, t1, t2)
|
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]
|
// From4 converts a function with 5 parameters returning a tuple into a function with 4 parameters returning a [GRA]
|
||||||
@ -94,8 +91,7 @@ func Eitherize4[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3) (R, error), GIOA ~
|
|||||||
return From4[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3) func() (R, error) {
|
return From4[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3)
|
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]
|
// From5 converts a function with 6 parameters returning a tuple into a function with 5 parameters returning a [GRA]
|
||||||
@ -112,8 +108,7 @@ func Eitherize5[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4) (R, error), GI
|
|||||||
return From5[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4) func() (R, error) {
|
return From5[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4) func() (R, error) {
|
||||||
return func() (R, error) {
|
return func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4)
|
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]
|
// From6 converts a function with 7 parameters returning a tuple into a function with 6 parameters returning a [GRA]
|
||||||
@ -130,8 +125,7 @@ func Eitherize6[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5) (R, error)
|
|||||||
return From6[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5) func() (R, error) {
|
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 func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4, t5)
|
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]
|
// From7 converts a function with 8 parameters returning a tuple into a function with 7 parameters returning a [GRA]
|
||||||
@ -148,8 +142,7 @@ func Eitherize7[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6) (R, er
|
|||||||
return From7[GRA](func(r C, t0 T0, t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6) func() (R, error) {
|
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 func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4, t5, t6)
|
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]
|
// From8 converts a function with 9 parameters returning a tuple into a function with 8 parameters returning a [GRA]
|
||||||
@ -166,8 +159,7 @@ func Eitherize8[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7) (R
|
|||||||
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 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 func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4, t5, t6, t7)
|
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]
|
// From9 converts a function with 10 parameters returning a tuple into a function with 9 parameters returning a [GRA]
|
||||||
@ -184,8 +176,7 @@ func Eitherize9[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T8
|
|||||||
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 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 func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8)
|
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]
|
// From10 converts a function with 11 parameters returning a tuple into a function with 10 parameters returning a [GRA]
|
||||||
@ -202,6 +193,5 @@ func Eitherize10[GRA ~func(C) GIOA, F ~func(C, T0, T1, T2, T3, T4, T5, T6, T7, T
|
|||||||
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 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 func() (R, error) {
|
||||||
return f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9)
|
return f(r, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9)
|
||||||
}
|
}})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
223
tuple/gen.go
223
tuple/gen.go
@ -1,8 +1,9 @@
|
|||||||
// 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
|
||||||
// 2023-07-19 16:18:58.7230486 +0200 CEST m=+0.015290301
|
// 2023-07-20 16:14:50.7418331 +0200 CEST m=+0.011380701
|
||||||
package tuple
|
package tuple
|
||||||
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
M "github.com/IBM/fp-go/monoid"
|
M "github.com/IBM/fp-go/monoid"
|
||||||
O "github.com/IBM/fp-go/ord"
|
O "github.com/IBM/fp-go/ord"
|
||||||
@ -134,9 +135,7 @@ func Monoid1[T1 any](m1 M.Monoid[T1]) M.Monoid[Tuple1[T1]] {
|
|||||||
// Ord1 creates n [Ord] for a [Tuple1] based on 1 [Ord]s for the contained types
|
// Ord1 creates n [Ord] for a [Tuple1] based on 1 [Ord]s for the contained types
|
||||||
func Ord1[T1 any](o1 O.Ord[T1]) O.Ord[Tuple1[T1]] {
|
func Ord1[T1 any](o1 O.Ord[T1]) O.Ord[Tuple1[T1]] {
|
||||||
return O.MakeOrd(func(l, r Tuple1[T1]) int {
|
return O.MakeOrd(func(l, r Tuple1[T1]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple1[T1]) bool {
|
}, func(l, r Tuple1[T1]) bool {
|
||||||
return o1.Equals(l.F1, r.F1)
|
return o1.Equals(l.F1, r.F1)
|
||||||
@ -188,12 +187,8 @@ func Monoid2[T1, T2 any](m1 M.Monoid[T1], m2 M.Monoid[T2]) M.Monoid[Tuple2[T1, T
|
|||||||
// Ord2 creates n [Ord] for a [Tuple2] based on 2 [Ord]s for the contained types
|
// Ord2 creates n [Ord] for a [Tuple2] based on 2 [Ord]s for the contained types
|
||||||
func Ord2[T1, T2 any](o1 O.Ord[T1], o2 O.Ord[T2]) O.Ord[Tuple2[T1, T2]] {
|
func Ord2[T1, T2 any](o1 O.Ord[T1], o2 O.Ord[T2]) O.Ord[Tuple2[T1, T2]] {
|
||||||
return O.MakeOrd(func(l, r Tuple2[T1, T2]) int {
|
return O.MakeOrd(func(l, r Tuple2[T1, T2]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple2[T1, T2]) bool {
|
}, func(l, r Tuple2[T1, T2]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2)
|
||||||
@ -246,15 +241,9 @@ func Monoid3[T1, T2, T3 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3])
|
|||||||
// Ord3 creates n [Ord] for a [Tuple3] based on 3 [Ord]s for the contained types
|
// Ord3 creates n [Ord] for a [Tuple3] based on 3 [Ord]s for the contained types
|
||||||
func Ord3[T1, T2, T3 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3]) O.Ord[Tuple3[T1, T2, T3]] {
|
func Ord3[T1, T2, T3 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3]) O.Ord[Tuple3[T1, T2, T3]] {
|
||||||
return O.MakeOrd(func(l, r Tuple3[T1, T2, T3]) int {
|
return O.MakeOrd(func(l, r Tuple3[T1, T2, T3]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple3[T1, T2, T3]) bool {
|
}, func(l, r Tuple3[T1, T2, T3]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3)
|
||||||
@ -308,18 +297,10 @@ func Monoid4[T1, T2, T3, T4 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T
|
|||||||
// Ord4 creates n [Ord] for a [Tuple4] based on 4 [Ord]s for the contained types
|
// Ord4 creates n [Ord] for a [Tuple4] based on 4 [Ord]s for the contained types
|
||||||
func Ord4[T1, T2, T3, T4 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4]) O.Ord[Tuple4[T1, T2, T3, T4]] {
|
func Ord4[T1, T2, T3, T4 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4]) O.Ord[Tuple4[T1, T2, T3, T4]] {
|
||||||
return O.MakeOrd(func(l, r Tuple4[T1, T2, T3, T4]) int {
|
return O.MakeOrd(func(l, r Tuple4[T1, T2, T3, T4]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple4[T1, T2, T3, T4]) bool {
|
}, func(l, r Tuple4[T1, T2, T3, T4]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4)
|
||||||
@ -374,21 +355,11 @@ func Monoid5[T1, T2, T3, T4, T5 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Mono
|
|||||||
// Ord5 creates n [Ord] for a [Tuple5] based on 5 [Ord]s for the contained types
|
// Ord5 creates n [Ord] for a [Tuple5] based on 5 [Ord]s for the contained types
|
||||||
func Ord5[T1, T2, T3, T4, T5 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5]) O.Ord[Tuple5[T1, T2, T3, T4, T5]] {
|
func Ord5[T1, T2, T3, T4, T5 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5]) O.Ord[Tuple5[T1, T2, T3, T4, T5]] {
|
||||||
return O.MakeOrd(func(l, r Tuple5[T1, T2, T3, T4, T5]) int {
|
return O.MakeOrd(func(l, r Tuple5[T1, T2, T3, T4, T5]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple5[T1, T2, T3, T4, T5]) bool {
|
}, func(l, r Tuple5[T1, T2, T3, T4, T5]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5)
|
||||||
@ -444,24 +415,12 @@ func Monoid6[T1, T2, T3, T4, T5, T6 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.
|
|||||||
// Ord6 creates n [Ord] for a [Tuple6] based on 6 [Ord]s for the contained types
|
// Ord6 creates n [Ord] for a [Tuple6] based on 6 [Ord]s for the contained types
|
||||||
func Ord6[T1, T2, T3, T4, T5, T6 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6]) O.Ord[Tuple6[T1, T2, T3, T4, T5, T6]] {
|
func Ord6[T1, T2, T3, T4, T5, T6 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6]) O.Ord[Tuple6[T1, T2, T3, T4, T5, T6]] {
|
||||||
return O.MakeOrd(func(l, r Tuple6[T1, T2, T3, T4, T5, T6]) int {
|
return O.MakeOrd(func(l, r Tuple6[T1, T2, T3, T4, T5, T6]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
if c:= o6.Compare(l.F6, r.F6); c != 0 {return c}
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o6.Compare(l.F6, r.F6); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple6[T1, T2, T3, T4, T5, T6]) bool {
|
}, func(l, r Tuple6[T1, T2, T3, T4, T5, T6]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6)
|
||||||
@ -518,27 +477,13 @@ func Monoid7[T1, T2, T3, T4, T5, T6, T7 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m
|
|||||||
// Ord7 creates n [Ord] for a [Tuple7] based on 7 [Ord]s for the contained types
|
// Ord7 creates n [Ord] for a [Tuple7] based on 7 [Ord]s for the contained types
|
||||||
func Ord7[T1, T2, T3, T4, T5, T6, T7 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7]) O.Ord[Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
|
func Ord7[T1, T2, T3, T4, T5, T6, T7 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7]) O.Ord[Tuple7[T1, T2, T3, T4, T5, T6, T7]] {
|
||||||
return O.MakeOrd(func(l, r Tuple7[T1, T2, T3, T4, T5, T6, T7]) int {
|
return O.MakeOrd(func(l, r Tuple7[T1, T2, T3, T4, T5, T6, T7]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
if c:= o6.Compare(l.F6, r.F6); c != 0 {return c}
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
if c:= o7.Compare(l.F7, r.F7); c != 0 {return c}
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o6.Compare(l.F6, r.F6); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o7.Compare(l.F7, r.F7); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple7[T1, T2, T3, T4, T5, T6, T7]) bool {
|
}, func(l, r Tuple7[T1, T2, T3, T4, T5, T6, T7]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7)
|
||||||
@ -596,30 +541,14 @@ func Monoid8[T1, T2, T3, T4, T5, T6, T7, T8 any](m1 M.Monoid[T1], m2 M.Monoid[T2
|
|||||||
// Ord8 creates n [Ord] for a [Tuple8] based on 8 [Ord]s for the contained types
|
// Ord8 creates n [Ord] for a [Tuple8] based on 8 [Ord]s for the contained types
|
||||||
func Ord8[T1, T2, T3, T4, T5, T6, T7, T8 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8]) O.Ord[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
|
func Ord8[T1, T2, T3, T4, T5, T6, T7, T8 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8]) O.Ord[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] {
|
||||||
return O.MakeOrd(func(l, r Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) int {
|
return O.MakeOrd(func(l, r Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
if c:= o6.Compare(l.F6, r.F6); c != 0 {return c}
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
if c:= o7.Compare(l.F7, r.F7); c != 0 {return c}
|
||||||
return c
|
if c:= o8.Compare(l.F8, r.F8); c != 0 {return c}
|
||||||
}
|
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o6.Compare(l.F6, r.F6); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o7.Compare(l.F7, r.F7); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o8.Compare(l.F8, r.F8); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) bool {
|
}, func(l, r Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8)
|
||||||
@ -678,33 +607,15 @@ func Monoid9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](m1 M.Monoid[T1], m2 M.Monoi
|
|||||||
// Ord9 creates n [Ord] for a [Tuple9] based on 9 [Ord]s for the contained types
|
// Ord9 creates n [Ord] for a [Tuple9] based on 9 [Ord]s for the contained types
|
||||||
func Ord9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8], o9 O.Ord[T9]) O.Ord[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
|
func Ord9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8], o9 O.Ord[T9]) O.Ord[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] {
|
||||||
return O.MakeOrd(func(l, r Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) int {
|
return O.MakeOrd(func(l, r Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
if c:= o6.Compare(l.F6, r.F6); c != 0 {return c}
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
if c:= o7.Compare(l.F7, r.F7); c != 0 {return c}
|
||||||
return c
|
if c:= o8.Compare(l.F8, r.F8); c != 0 {return c}
|
||||||
}
|
if c:= o9.Compare(l.F9, r.F9); c != 0 {return c}
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o6.Compare(l.F6, r.F6); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o7.Compare(l.F7, r.F7); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o8.Compare(l.F8, r.F8); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o9.Compare(l.F9, r.F9); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) bool {
|
}, func(l, r Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8) && o9.Equals(l.F9, r.F9)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8) && o9.Equals(l.F9, r.F9)
|
||||||
@ -764,36 +675,16 @@ func Monoid10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](m1 M.Monoid[T1], m2 M
|
|||||||
// Ord10 creates n [Ord] for a [Tuple10] based on 10 [Ord]s for the contained types
|
// Ord10 creates n [Ord] for a [Tuple10] based on 10 [Ord]s for the contained types
|
||||||
func Ord10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8], o9 O.Ord[T9], o10 O.Ord[T10]) O.Ord[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
|
func Ord10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3], o4 O.Ord[T4], o5 O.Ord[T5], o6 O.Ord[T6], o7 O.Ord[T7], o8 O.Ord[T8], o9 O.Ord[T9], o10 O.Ord[T10]) O.Ord[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] {
|
||||||
return O.MakeOrd(func(l, r Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) int {
|
return O.MakeOrd(func(l, r Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) int {
|
||||||
if c := o1.Compare(l.F1, r.F1); c != 0 {
|
if c:= o1.Compare(l.F1, r.F1); c != 0 {return c}
|
||||||
return c
|
if c:= o2.Compare(l.F2, r.F2); c != 0 {return c}
|
||||||
}
|
if c:= o3.Compare(l.F3, r.F3); c != 0 {return c}
|
||||||
if c := o2.Compare(l.F2, r.F2); c != 0 {
|
if c:= o4.Compare(l.F4, r.F4); c != 0 {return c}
|
||||||
return c
|
if c:= o5.Compare(l.F5, r.F5); c != 0 {return c}
|
||||||
}
|
if c:= o6.Compare(l.F6, r.F6); c != 0 {return c}
|
||||||
if c := o3.Compare(l.F3, r.F3); c != 0 {
|
if c:= o7.Compare(l.F7, r.F7); c != 0 {return c}
|
||||||
return c
|
if c:= o8.Compare(l.F8, r.F8); c != 0 {return c}
|
||||||
}
|
if c:= o9.Compare(l.F9, r.F9); c != 0 {return c}
|
||||||
if c := o4.Compare(l.F4, r.F4); c != 0 {
|
if c:= o10.Compare(l.F10, r.F10); c != 0 {return c}
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o5.Compare(l.F5, r.F5); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o6.Compare(l.F6, r.F6); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o7.Compare(l.F7, r.F7); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o8.Compare(l.F8, r.F8); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o9.Compare(l.F9, r.F9); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
if c := o10.Compare(l.F10, r.F10); c != 0 {
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
return 0
|
return 0
|
||||||
}, func(l, r Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) bool {
|
}, func(l, r Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) bool {
|
||||||
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8) && o9.Equals(l.F9, r.F9) && o10.Equals(l.F10, r.F10)
|
return o1.Equals(l.F1, r.F1) && o2.Equals(l.F2, r.F2) && o3.Equals(l.F3, r.F3) && o4.Equals(l.F4, r.F4) && o5.Equals(l.F5, r.F5) && o6.Equals(l.F6, r.F6) && o7.Equals(l.F7, r.F7) && o8.Equals(l.F8, r.F8) && o9.Equals(l.F9, r.F9) && o10.Equals(l.F10, r.F10)
|
||||||
|
Reference in New Issue
Block a user