tuple

package
v1.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 19

Documentation

Overview

Package tuple contains type definitions and functions for data structures for tuples of heterogenous types. For homogeneous types consider to use arrays for simplicity

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BiMap

func BiMap[E, G, A, B any](mapSnd func(E) G, mapFst func(A) B) func(Tuple2[A, E]) Tuple2[B, G]

func First

func First[T1, T2 any](t Tuple2[T1, T2]) T1

First returns the first element of a Tuple2

func FromArray1 added in v1.0.8

func FromArray1[F1 ~func(R) T1, T1, R any](f1 F1) func(r []R) Tuple1[T1]

FromArray converts an array of [R] into a Tuple1 using 1 functions from [R] to [T] The inverse function is ToArray1

func FromArray10 added in v1.0.8

func FromArray10[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, F6 ~func(R) T6, F7 ~func(R) T7, F8 ~func(R) T8, F9 ~func(R) T9, F10 ~func(R) T10, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(r []R) Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

FromArray converts an array of [R] into a Tuple10 using 10 functions from [R] to [T] The inverse function is ToArray10

func FromArray2 added in v1.0.8

func FromArray2[F1 ~func(R) T1, F2 ~func(R) T2, T1, T2, R any](f1 F1, f2 F2) func(r []R) Tuple2[T1, T2]

FromArray converts an array of [R] into a Tuple2 using 2 functions from [R] to [T] The inverse function is ToArray2

func FromArray3 added in v1.0.8

func FromArray3[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, T1, T2, T3, R any](f1 F1, f2 F2, f3 F3) func(r []R) Tuple3[T1, T2, T3]

FromArray converts an array of [R] into a Tuple3 using 3 functions from [R] to [T] The inverse function is ToArray3

func FromArray4 added in v1.0.8

func FromArray4[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, T1, T2, T3, T4, R any](f1 F1, f2 F2, f3 F3, f4 F4) func(r []R) Tuple4[T1, T2, T3, T4]

FromArray converts an array of [R] into a Tuple4 using 4 functions from [R] to [T] The inverse function is ToArray4

func FromArray5 added in v1.0.8

func FromArray5[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, T1, T2, T3, T4, T5, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(r []R) Tuple5[T1, T2, T3, T4, T5]

FromArray converts an array of [R] into a Tuple5 using 5 functions from [R] to [T] The inverse function is ToArray5

func FromArray6 added in v1.0.8

func FromArray6[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, F6 ~func(R) T6, T1, T2, T3, T4, T5, T6, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(r []R) Tuple6[T1, T2, T3, T4, T5, T6]

FromArray converts an array of [R] into a Tuple6 using 6 functions from [R] to [T] The inverse function is ToArray6

func FromArray7 added in v1.0.8

func FromArray7[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, F6 ~func(R) T6, F7 ~func(R) T7, T1, T2, T3, T4, T5, T6, T7, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(r []R) Tuple7[T1, T2, T3, T4, T5, T6, T7]

FromArray converts an array of [R] into a Tuple7 using 7 functions from [R] to [T] The inverse function is ToArray7

func FromArray8 added in v1.0.8

func FromArray8[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, F6 ~func(R) T6, F7 ~func(R) T7, F8 ~func(R) T8, T1, T2, T3, T4, T5, T6, T7, T8, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(r []R) Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]

FromArray converts an array of [R] into a Tuple8 using 8 functions from [R] to [T] The inverse function is ToArray8

func FromArray9 added in v1.0.8

func FromArray9[F1 ~func(R) T1, F2 ~func(R) T2, F3 ~func(R) T3, F4 ~func(R) T4, F5 ~func(R) T5, F6 ~func(R) T6, F7 ~func(R) T7, F8 ~func(R) T8, F9 ~func(R) T9, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(r []R) Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]

FromArray converts an array of [R] into a Tuple9 using 9 functions from [R] to [T] The inverse function is ToArray9

func Map1

func Map1[F1 ~func(T1) R1, T1, R1 any](f1 F1) func(Tuple1[T1]) Tuple1[R1]

Map1 maps each value of a Tuple1 via a mapping function

func Map10

func Map10[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, F6 ~func(T6) R6, F7 ~func(T7) R7, F8 ~func(T8) R8, F9 ~func(T9) R9, F10 ~func(T10) R10, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5, T6, R6, T7, R7, T8, R8, T9, R9, T10, R10 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) Tuple10[R1, R2, R3, R4, R5, R6, R7, R8, R9, R10]

Map10 maps each value of a Tuple10 via a mapping function

func Map2

func Map2[F1 ~func(T1) R1, F2 ~func(T2) R2, T1, R1, T2, R2 any](f1 F1, f2 F2) func(Tuple2[T1, T2]) Tuple2[R1, R2]

Map2 maps each value of a Tuple2 via a mapping function

func Map3

func Map3[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, T1, R1, T2, R2, T3, R3 any](f1 F1, f2 F2, f3 F3) func(Tuple3[T1, T2, T3]) Tuple3[R1, R2, R3]

Map3 maps each value of a Tuple3 via a mapping function

func Map4

func Map4[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, T1, R1, T2, R2, T3, R3, T4, R4 any](f1 F1, f2 F2, f3 F3, f4 F4) func(Tuple4[T1, T2, T3, T4]) Tuple4[R1, R2, R3, R4]

Map4 maps each value of a Tuple4 via a mapping function

func Map5

func Map5[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(Tuple5[T1, T2, T3, T4, T5]) Tuple5[R1, R2, R3, R4, R5]

Map5 maps each value of a Tuple5 via a mapping function

func Map6

func Map6[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, F6 ~func(T6) R6, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5, T6, R6 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(Tuple6[T1, T2, T3, T4, T5, T6]) Tuple6[R1, R2, R3, R4, R5, R6]

Map6 maps each value of a Tuple6 via a mapping function

func Map7

func Map7[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, F6 ~func(T6) R6, F7 ~func(T7) R7, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5, T6, R6, T7, R7 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(Tuple7[T1, T2, T3, T4, T5, T6, T7]) Tuple7[R1, R2, R3, R4, R5, R6, R7]

Map7 maps each value of a Tuple7 via a mapping function

func Map8

func Map8[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, F6 ~func(T6) R6, F7 ~func(T7) R7, F8 ~func(T8) R8, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5, T6, R6, T7, R7, T8, R8 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Tuple8[R1, R2, R3, R4, R5, R6, R7, R8]

Map8 maps each value of a Tuple8 via a mapping function

func Map9

func Map9[F1 ~func(T1) R1, F2 ~func(T2) R2, F3 ~func(T3) R3, F4 ~func(T4) R4, F5 ~func(T5) R5, F6 ~func(T6) R6, F7 ~func(T7) R7, F8 ~func(T8) R8, F9 ~func(T9) R9, T1, R1, T2, R2, T3, R3, T4, R4, T5, R5, T6, R6, T7, R7, T8, R8, T9, R9 any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Tuple9[R1, R2, R3, R4, R5, R6, R7, R8, R9]

Map9 maps each value of a Tuple9 via a mapping function

func Monoid1

func Monoid1[T1 any](m1 M.Monoid[T1]) M.Monoid[Tuple1[T1]]

Monoid1 creates a [Monoid] for a Tuple1 based on 1 monoids for the contained types

func Monoid10

func Monoid10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5], m6 M.Monoid[T6], m7 M.Monoid[T7], m8 M.Monoid[T8], m9 M.Monoid[T9], m10 M.Monoid[T10]) M.Monoid[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]]

Monoid10 creates a [Monoid] for a Tuple10 based on 10 monoids for the contained types

func Monoid2

func Monoid2[T1, T2 any](m1 M.Monoid[T1], m2 M.Monoid[T2]) M.Monoid[Tuple2[T1, T2]]

Monoid2 creates a [Monoid] for a Tuple2 based on 2 monoids for the contained types

func Monoid3

func Monoid3[T1, T2, T3 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3]) M.Monoid[Tuple3[T1, T2, T3]]

Monoid3 creates a [Monoid] for a Tuple3 based on 3 monoids for the contained types

func Monoid4

func Monoid4[T1, T2, T3, T4 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4]) M.Monoid[Tuple4[T1, T2, T3, T4]]

Monoid4 creates a [Monoid] for a Tuple4 based on 4 monoids for the contained types

func Monoid5

func Monoid5[T1, T2, T3, T4, T5 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5]) M.Monoid[Tuple5[T1, T2, T3, T4, T5]]

Monoid5 creates a [Monoid] for a Tuple5 based on 5 monoids for the contained types

func Monoid6

func Monoid6[T1, T2, T3, T4, T5, T6 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5], m6 M.Monoid[T6]) M.Monoid[Tuple6[T1, T2, T3, T4, T5, T6]]

Monoid6 creates a [Monoid] for a Tuple6 based on 6 monoids for the contained types

func Monoid7

func Monoid7[T1, T2, T3, T4, T5, T6, T7 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5], m6 M.Monoid[T6], m7 M.Monoid[T7]) M.Monoid[Tuple7[T1, T2, T3, T4, T5, T6, T7]]

Monoid7 creates a [Monoid] for a Tuple7 based on 7 monoids for the contained types

func Monoid8

func Monoid8[T1, T2, T3, T4, T5, T6, T7, T8 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5], m6 M.Monoid[T6], m7 M.Monoid[T7], m8 M.Monoid[T8]) M.Monoid[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]]

Monoid8 creates a [Monoid] for a Tuple8 based on 8 monoids for the contained types

func Monoid9

func Monoid9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](m1 M.Monoid[T1], m2 M.Monoid[T2], m3 M.Monoid[T3], m4 M.Monoid[T4], m5 M.Monoid[T5], m6 M.Monoid[T6], m7 M.Monoid[T7], m8 M.Monoid[T8], m9 M.Monoid[T9]) M.Monoid[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]]

Monoid9 creates a [Monoid] for a Tuple9 based on 9 monoids for the contained types

func Of2 added in v1.0.20

func Of2[T1, T2 any](e T2) func(T1) Tuple2[T1, T2]

func Ord1

func Ord1[T1 any](o1 O.Ord[T1]) O.Ord[Tuple1[T1]]

Ord1 creates n [Ord] for a Tuple1 based on 1 [Ord]s for the contained types

func Ord10

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]]

Ord10 creates n [Ord] for a Tuple10 based on 10 [Ord]s for the contained types

func Ord2

func Ord2[T1, T2 any](o1 O.Ord[T1], o2 O.Ord[T2]) O.Ord[Tuple2[T1, T2]]

Ord2 creates n [Ord] for a Tuple2 based on 2 [Ord]s for the contained types

func Ord3

func Ord3[T1, T2, T3 any](o1 O.Ord[T1], o2 O.Ord[T2], o3 O.Ord[T3]) O.Ord[Tuple3[T1, T2, T3]]

Ord3 creates n [Ord] for a Tuple3 based on 3 [Ord]s for the contained types

func Ord4

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]]

Ord4 creates n [Ord] for a Tuple4 based on 4 [Ord]s for the contained types

func Ord5

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]]

Ord5 creates n [Ord] for a Tuple5 based on 5 [Ord]s for the contained types

func Ord6

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]]

Ord6 creates n [Ord] for a Tuple6 based on 6 [Ord]s for the contained types

func Ord7

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]]

Ord7 creates n [Ord] for a Tuple7 based on 7 [Ord]s for the contained types

func Ord8

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]]

Ord8 creates n [Ord] for a Tuple8 based on 8 [Ord]s for the contained types

func Ord9

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]]

Ord9 creates n [Ord] for a Tuple9 based on 9 [Ord]s for the contained types

func Push1 added in v1.0.20

func Push1[T1, T2 any](value T2) func(Tuple1[T1]) Tuple2[T1, T2]

Push1 creates a Tuple2 from a Tuple1 by appending a constant value

func Push2 added in v1.0.20

func Push2[T1, T2, T3 any](value T3) func(Tuple2[T1, T2]) Tuple3[T1, T2, T3]

Push2 creates a Tuple3 from a Tuple2 by appending a constant value

func Push3 added in v1.0.20

func Push3[T1, T2, T3, T4 any](value T4) func(Tuple3[T1, T2, T3]) Tuple4[T1, T2, T3, T4]

Push3 creates a Tuple4 from a Tuple3 by appending a constant value

func Push4 added in v1.0.20

func Push4[T1, T2, T3, T4, T5 any](value T5) func(Tuple4[T1, T2, T3, T4]) Tuple5[T1, T2, T3, T4, T5]

Push4 creates a Tuple5 from a Tuple4 by appending a constant value

func Push5 added in v1.0.20

func Push5[T1, T2, T3, T4, T5, T6 any](value T6) func(Tuple5[T1, T2, T3, T4, T5]) Tuple6[T1, T2, T3, T4, T5, T6]

Push5 creates a Tuple6 from a Tuple5 by appending a constant value

func Push6 added in v1.0.20

func Push6[T1, T2, T3, T4, T5, T6, T7 any](value T7) func(Tuple6[T1, T2, T3, T4, T5, T6]) Tuple7[T1, T2, T3, T4, T5, T6, T7]

Push6 creates a Tuple7 from a Tuple6 by appending a constant value

func Push7 added in v1.0.20

func Push7[T1, T2, T3, T4, T5, T6, T7, T8 any](value T8) func(Tuple7[T1, T2, T3, T4, T5, T6, T7]) Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]

Push7 creates a Tuple8 from a Tuple7 by appending a constant value

func Push8 added in v1.0.20

func Push8[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](value T9) func(Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]

Push8 creates a Tuple9 from a Tuple8 by appending a constant value

func Push9 added in v1.0.20

func Push9[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](value T10) func(Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

Push9 creates a Tuple10 from a Tuple9 by appending a constant value

func Second

func Second[T1, T2 any](t Tuple2[T1, T2]) T2

Second returns the second element of a Tuple2

func ToArray1 added in v1.0.8

func ToArray1[F1 ~func(T1) R, T1, R any](f1 F1) func(t Tuple1[T1]) []R

ToArray converts the Tuple1 into an array of type [R] using 1 transformation functions from [T] to [R] The inverse function is FromArray1

func ToArray10 added in v1.0.8

func ToArray10[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, F6 ~func(T6) R, F7 ~func(T7) R, F8 ~func(T8) R, F9 ~func(T9) R, F10 ~func(T10) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9, f10 F10) func(t Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) []R

ToArray converts the Tuple10 into an array of type [R] using 10 transformation functions from [T] to [R] The inverse function is FromArray10

func ToArray2 added in v1.0.8

func ToArray2[F1 ~func(T1) R, F2 ~func(T2) R, T1, T2, R any](f1 F1, f2 F2) func(t Tuple2[T1, T2]) []R

ToArray converts the Tuple2 into an array of type [R] using 2 transformation functions from [T] to [R] The inverse function is FromArray2

func ToArray3 added in v1.0.8

func ToArray3[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, T1, T2, T3, R any](f1 F1, f2 F2, f3 F3) func(t Tuple3[T1, T2, T3]) []R

ToArray converts the Tuple3 into an array of type [R] using 3 transformation functions from [T] to [R] The inverse function is FromArray3

func ToArray4 added in v1.0.8

func ToArray4[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, T1, T2, T3, T4, R any](f1 F1, f2 F2, f3 F3, f4 F4) func(t Tuple4[T1, T2, T3, T4]) []R

ToArray converts the Tuple4 into an array of type [R] using 4 transformation functions from [T] to [R] The inverse function is FromArray4

func ToArray5 added in v1.0.8

func ToArray5[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, T1, T2, T3, T4, T5, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5) func(t Tuple5[T1, T2, T3, T4, T5]) []R

ToArray converts the Tuple5 into an array of type [R] using 5 transformation functions from [T] to [R] The inverse function is FromArray5

func ToArray6 added in v1.0.8

func ToArray6[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, F6 ~func(T6) R, T1, T2, T3, T4, T5, T6, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6) func(t Tuple6[T1, T2, T3, T4, T5, T6]) []R

ToArray converts the Tuple6 into an array of type [R] using 6 transformation functions from [T] to [R] The inverse function is FromArray6

func ToArray7 added in v1.0.8

func ToArray7[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, F6 ~func(T6) R, F7 ~func(T7) R, T1, T2, T3, T4, T5, T6, T7, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7) func(t Tuple7[T1, T2, T3, T4, T5, T6, T7]) []R

ToArray converts the Tuple7 into an array of type [R] using 7 transformation functions from [T] to [R] The inverse function is FromArray7

func ToArray8 added in v1.0.8

func ToArray8[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, F6 ~func(T6) R, F7 ~func(T7) R, F8 ~func(T8) R, T1, T2, T3, T4, T5, T6, T7, T8, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8) func(t Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) []R

ToArray converts the Tuple8 into an array of type [R] using 8 transformation functions from [T] to [R] The inverse function is FromArray8

func ToArray9 added in v1.0.8

func ToArray9[F1 ~func(T1) R, F2 ~func(T2) R, F3 ~func(T3) R, F4 ~func(T4) R, F5 ~func(T5) R, F6 ~func(T6) R, F7 ~func(T7) R, F8 ~func(T8) R, F9 ~func(T9) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f1 F1, f2 F2, f3 F3, f4 F4, f5 F5, f6 F6, f7 F7, f8 F8, f9 F9) func(t Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) []R

ToArray converts the Tuple9 into an array of type [R] using 9 transformation functions from [T] to [R] The inverse function is FromArray9

func Tupled1

func Tupled1[F ~func(T1) R, T1, R any](f F) func(Tuple1[T1]) R

Tupled1 converts a function with 1 parameters into a function taking a Tuple1 The inverse function is Untupled1

func Tupled10

func Tupled10[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) R

Tupled10 converts a function with 10 parameters into a function taking a Tuple10 The inverse function is Untupled10

func Tupled2

func Tupled2[F ~func(T1, T2) R, T1, T2, R any](f F) func(Tuple2[T1, T2]) R

Tupled2 converts a function with 2 parameters into a function taking a Tuple2 The inverse function is Untupled2

func Tupled3

func Tupled3[F ~func(T1, T2, T3) R, T1, T2, T3, R any](f F) func(Tuple3[T1, T2, T3]) R

Tupled3 converts a function with 3 parameters into a function taking a Tuple3 The inverse function is Untupled3

func Tupled4

func Tupled4[F ~func(T1, T2, T3, T4) R, T1, T2, T3, T4, R any](f F) func(Tuple4[T1, T2, T3, T4]) R

Tupled4 converts a function with 4 parameters into a function taking a Tuple4 The inverse function is Untupled4

func Tupled5

func Tupled5[F ~func(T1, T2, T3, T4, T5) R, T1, T2, T3, T4, T5, R any](f F) func(Tuple5[T1, T2, T3, T4, T5]) R

Tupled5 converts a function with 5 parameters into a function taking a Tuple5 The inverse function is Untupled5

func Tupled6

func Tupled6[F ~func(T1, T2, T3, T4, T5, T6) R, T1, T2, T3, T4, T5, T6, R any](f F) func(Tuple6[T1, T2, T3, T4, T5, T6]) R

Tupled6 converts a function with 6 parameters into a function taking a Tuple6 The inverse function is Untupled6

func Tupled7

func Tupled7[F ~func(T1, T2, T3, T4, T5, T6, T7) R, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(Tuple7[T1, T2, T3, T4, T5, T6, T7]) R

Tupled7 converts a function with 7 parameters into a function taking a Tuple7 The inverse function is Untupled7

func Tupled8

func Tupled8[F ~func(T1, T2, T3, T4, T5, T6, T7, T8) R, T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) R

Tupled8 converts a function with 8 parameters into a function taking a Tuple8 The inverse function is Untupled8

func Tupled9

func Tupled9[F ~func(T1, T2, T3, T4, T5, T6, T7, T8, T9) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) R

Tupled9 converts a function with 9 parameters into a function taking a Tuple9 The inverse function is Untupled9

func Untupled1

func Untupled1[F ~func(Tuple1[T1]) R, T1, R any](f F) func(T1) R

Untupled1 converts a function with a Tuple1 parameter into a function with 1 parameters The inverse function is Tupled1

func Untupled10

func Untupled10[F ~func(Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) R

Untupled10 converts a function with a Tuple10 parameter into a function with 10 parameters The inverse function is Tupled10

func Untupled2

func Untupled2[F ~func(Tuple2[T1, T2]) R, T1, T2, R any](f F) func(T1, T2) R

Untupled2 converts a function with a Tuple2 parameter into a function with 2 parameters The inverse function is Tupled2

func Untupled3

func Untupled3[F ~func(Tuple3[T1, T2, T3]) R, T1, T2, T3, R any](f F) func(T1, T2, T3) R

Untupled3 converts a function with a Tuple3 parameter into a function with 3 parameters The inverse function is Tupled3

func Untupled4

func Untupled4[F ~func(Tuple4[T1, T2, T3, T4]) R, T1, T2, T3, T4, R any](f F) func(T1, T2, T3, T4) R

Untupled4 converts a function with a Tuple4 parameter into a function with 4 parameters The inverse function is Tupled4

func Untupled5

func Untupled5[F ~func(Tuple5[T1, T2, T3, T4, T5]) R, T1, T2, T3, T4, T5, R any](f F) func(T1, T2, T3, T4, T5) R

Untupled5 converts a function with a Tuple5 parameter into a function with 5 parameters The inverse function is Tupled5

func Untupled6

func Untupled6[F ~func(Tuple6[T1, T2, T3, T4, T5, T6]) R, T1, T2, T3, T4, T5, T6, R any](f F) func(T1, T2, T3, T4, T5, T6) R

Untupled6 converts a function with a Tuple6 parameter into a function with 6 parameters The inverse function is Tupled6

func Untupled7

func Untupled7[F ~func(Tuple7[T1, T2, T3, T4, T5, T6, T7]) R, T1, T2, T3, T4, T5, T6, T7, R any](f F) func(T1, T2, T3, T4, T5, T6, T7) R

Untupled7 converts a function with a Tuple7 parameter into a function with 7 parameters The inverse function is Tupled7

func Untupled8

func Untupled8[F ~func(Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) R, T1, T2, T3, T4, T5, T6, T7, T8, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8) R

Untupled8 converts a function with a Tuple8 parameter into a function with 8 parameters The inverse function is Tupled8

func Untupled9

func Untupled9[F ~func(Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) R, T1, T2, T3, T4, T5, T6, T7, T8, T9, R any](f F) func(T1, T2, T3, T4, T5, T6, T7, T8, T9) R

Untupled9 converts a function with a Tuple9 parameter into a function with 9 parameters The inverse function is Tupled9

Types

type Tuple1

type Tuple1[T1 any] struct {
	F1 T1
}

Tuple1 is a struct that carries 1 independently typed values

func MakeTuple1

func MakeTuple1[T1 any](t1 T1) Tuple1[T1]

MakeTuple1 is a function that converts its 1 parameters into a Tuple1

func Of

func Of[T1 any](t T1) Tuple1[T1]

func Replicate1

func Replicate1[T any](t T) Tuple1[T]

Replicate1 creates a Tuple1 with all fields set to the input value `t`

func (Tuple1[T1]) MarshalJSON added in v1.0.8

func (t Tuple1[T1]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple1 into a JSON array

func (Tuple1[T1]) String added in v1.0.8

func (t Tuple1[T1]) String() string

String prints some debug info for the Tuple1

func (*Tuple1[T1]) UnmarshalJSON added in v1.0.8

func (t *Tuple1[T1]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple1

type Tuple10

type Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any] struct {
	F1  T1
	F2  T2
	F3  T3
	F4  T4
	F5  T5
	F6  T6
	F7  T7
	F8  T8
	F9  T9
	F10 T10
}

Tuple10 is a struct that carries 10 independently typed values

func MakeTuple10

func MakeTuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9, t10 T10) Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]

MakeTuple10 is a function that converts its 10 parameters into a Tuple10

func Replicate10

func Replicate10[T any](t T) Tuple10[T, T, T, T, T, T, T, T, T, T]

Replicate10 creates a Tuple10 with all fields set to the input value `t`

func (Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) MarshalJSON added in v1.0.8

func (t Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple10 into a JSON array

func (Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) String added in v1.0.8

func (t Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) String() string

String prints some debug info for the Tuple10

func (*Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) UnmarshalJSON added in v1.0.8

func (t *Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple10

type Tuple2

type Tuple2[T1, T2 any] struct {
	F1 T1
	F2 T2
}

Tuple2 is a struct that carries 2 independently typed values

func MakeTuple2

func MakeTuple2[T1, T2 any](t1 T1, t2 T2) Tuple2[T1, T2]

MakeTuple2 is a function that converts its 2 parameters into a Tuple2

func Replicate2

func Replicate2[T any](t T) Tuple2[T, T]

Replicate2 creates a Tuple2 with all fields set to the input value `t`

func Swap

func Swap[T1, T2 any](t Tuple2[T1, T2]) Tuple2[T2, T1]

func (Tuple2[T1, T2]) MarshalJSON added in v1.0.8

func (t Tuple2[T1, T2]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple2 into a JSON array

func (Tuple2[T1, T2]) String added in v1.0.8

func (t Tuple2[T1, T2]) String() string

String prints some debug info for the Tuple2

func (*Tuple2[T1, T2]) UnmarshalJSON added in v1.0.8

func (t *Tuple2[T1, T2]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple2

type Tuple3

type Tuple3[T1, T2, T3 any] struct {
	F1 T1
	F2 T2
	F3 T3
}

Tuple3 is a struct that carries 3 independently typed values

func MakeTuple3

func MakeTuple3[T1, T2, T3 any](t1 T1, t2 T2, t3 T3) Tuple3[T1, T2, T3]

MakeTuple3 is a function that converts its 3 parameters into a Tuple3

func Replicate3

func Replicate3[T any](t T) Tuple3[T, T, T]

Replicate3 creates a Tuple3 with all fields set to the input value `t`

func (Tuple3[T1, T2, T3]) MarshalJSON added in v1.0.8

func (t Tuple3[T1, T2, T3]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple3 into a JSON array

func (Tuple3[T1, T2, T3]) String added in v1.0.8

func (t Tuple3[T1, T2, T3]) String() string

String prints some debug info for the Tuple3

func (*Tuple3[T1, T2, T3]) UnmarshalJSON added in v1.0.8

func (t *Tuple3[T1, T2, T3]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple3

type Tuple4

type Tuple4[T1, T2, T3, T4 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
}

Tuple4 is a struct that carries 4 independently typed values

func MakeTuple4

func MakeTuple4[T1, T2, T3, T4 any](t1 T1, t2 T2, t3 T3, t4 T4) Tuple4[T1, T2, T3, T4]

MakeTuple4 is a function that converts its 4 parameters into a Tuple4

func Replicate4

func Replicate4[T any](t T) Tuple4[T, T, T, T]

Replicate4 creates a Tuple4 with all fields set to the input value `t`

func (Tuple4[T1, T2, T3, T4]) MarshalJSON added in v1.0.8

func (t Tuple4[T1, T2, T3, T4]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple4 into a JSON array

func (Tuple4[T1, T2, T3, T4]) String added in v1.0.8

func (t Tuple4[T1, T2, T3, T4]) String() string

String prints some debug info for the Tuple4

func (*Tuple4[T1, T2, T3, T4]) UnmarshalJSON added in v1.0.8

func (t *Tuple4[T1, T2, T3, T4]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple4

type Tuple5

type Tuple5[T1, T2, T3, T4, T5 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
	F5 T5
}

Tuple5 is a struct that carries 5 independently typed values

func MakeTuple5

func MakeTuple5[T1, T2, T3, T4, T5 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5) Tuple5[T1, T2, T3, T4, T5]

MakeTuple5 is a function that converts its 5 parameters into a Tuple5

func Replicate5

func Replicate5[T any](t T) Tuple5[T, T, T, T, T]

Replicate5 creates a Tuple5 with all fields set to the input value `t`

func (Tuple5[T1, T2, T3, T4, T5]) MarshalJSON added in v1.0.8

func (t Tuple5[T1, T2, T3, T4, T5]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple5 into a JSON array

func (Tuple5[T1, T2, T3, T4, T5]) String added in v1.0.8

func (t Tuple5[T1, T2, T3, T4, T5]) String() string

String prints some debug info for the Tuple5

func (*Tuple5[T1, T2, T3, T4, T5]) UnmarshalJSON added in v1.0.8

func (t *Tuple5[T1, T2, T3, T4, T5]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple5

type Tuple6

type Tuple6[T1, T2, T3, T4, T5, T6 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
	F5 T5
	F6 T6
}

Tuple6 is a struct that carries 6 independently typed values

func MakeTuple6

func MakeTuple6[T1, T2, T3, T4, T5, T6 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6) Tuple6[T1, T2, T3, T4, T5, T6]

MakeTuple6 is a function that converts its 6 parameters into a Tuple6

func Replicate6

func Replicate6[T any](t T) Tuple6[T, T, T, T, T, T]

Replicate6 creates a Tuple6 with all fields set to the input value `t`

func (Tuple6[T1, T2, T3, T4, T5, T6]) MarshalJSON added in v1.0.8

func (t Tuple6[T1, T2, T3, T4, T5, T6]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple6 into a JSON array

func (Tuple6[T1, T2, T3, T4, T5, T6]) String added in v1.0.8

func (t Tuple6[T1, T2, T3, T4, T5, T6]) String() string

String prints some debug info for the Tuple6

func (*Tuple6[T1, T2, T3, T4, T5, T6]) UnmarshalJSON added in v1.0.8

func (t *Tuple6[T1, T2, T3, T4, T5, T6]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple6

type Tuple7

type Tuple7[T1, T2, T3, T4, T5, T6, T7 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
	F5 T5
	F6 T6
	F7 T7
}

Tuple7 is a struct that carries 7 independently typed values

func MakeTuple7

func MakeTuple7[T1, T2, T3, T4, T5, T6, T7 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7) Tuple7[T1, T2, T3, T4, T5, T6, T7]

MakeTuple7 is a function that converts its 7 parameters into a Tuple7

func Replicate7

func Replicate7[T any](t T) Tuple7[T, T, T, T, T, T, T]

Replicate7 creates a Tuple7 with all fields set to the input value `t`

func (Tuple7[T1, T2, T3, T4, T5, T6, T7]) MarshalJSON added in v1.0.8

func (t Tuple7[T1, T2, T3, T4, T5, T6, T7]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple7 into a JSON array

func (Tuple7[T1, T2, T3, T4, T5, T6, T7]) String added in v1.0.8

func (t Tuple7[T1, T2, T3, T4, T5, T6, T7]) String() string

String prints some debug info for the Tuple7

func (*Tuple7[T1, T2, T3, T4, T5, T6, T7]) UnmarshalJSON added in v1.0.8

func (t *Tuple7[T1, T2, T3, T4, T5, T6, T7]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple7

type Tuple8

type Tuple8[T1, T2, T3, T4, T5, T6, T7, T8 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
	F5 T5
	F6 T6
	F7 T7
	F8 T8
}

Tuple8 is a struct that carries 8 independently typed values

func MakeTuple8

func MakeTuple8[T1, T2, T3, T4, T5, T6, T7, T8 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8) Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]

MakeTuple8 is a function that converts its 8 parameters into a Tuple8

func Replicate8

func Replicate8[T any](t T) Tuple8[T, T, T, T, T, T, T, T]

Replicate8 creates a Tuple8 with all fields set to the input value `t`

func (Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) MarshalJSON added in v1.0.8

func (t Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple8 into a JSON array

func (Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) String added in v1.0.8

func (t Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) String() string

String prints some debug info for the Tuple8

func (*Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) UnmarshalJSON added in v1.0.8

func (t *Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple8

type Tuple9

type Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any] struct {
	F1 T1
	F2 T2
	F3 T3
	F4 T4
	F5 T5
	F6 T6
	F7 T7
	F8 T8
	F9 T9
}

Tuple9 is a struct that carries 9 independently typed values

func MakeTuple9

func MakeTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](t1 T1, t2 T2, t3 T3, t4 T4, t5 T5, t6 T6, t7 T7, t8 T8, t9 T9) Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]

MakeTuple9 is a function that converts its 9 parameters into a Tuple9

func Replicate9

func Replicate9[T any](t T) Tuple9[T, T, T, T, T, T, T, T, T]

Replicate9 creates a Tuple9 with all fields set to the input value `t`

func (Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) MarshalJSON added in v1.0.8

func (t Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tuple9 into a JSON array

func (Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) String added in v1.0.8

func (t Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) String() string

String prints some debug info for the Tuple9

func (*Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) UnmarshalJSON added in v1.0.8

func (t *Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals a JSON array into a Tuple9

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL