either3

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package either3 provides cross type transformations for `mo.Either`.

The functions provided by this package are not methods of `mo.Either` due to the lack of method type parameters on methods. This is part of the design decision of the Go's generics as explained here: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#No-parameterized-methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapArg1

func MapArg1[In1 any, In2 any, In3 any, Out1 any](f func(In1) Out1) func(either mo.Either3[In1, In2, In3]) mo.Either3[Out1, In2, In3]

MapArg1 executes the given function, if Either3 use the first argument, and returns result.

func MapArg2

func MapArg2[In1 any, In2 any, In3 any, Out2 any](f func(In2) Out2) func(either mo.Either3[In1, In2, In3]) mo.Either3[In1, Out2, In3]

MapArg2 executes the given function, if Either3 use the second argument, and returns result.

func MapArg3

func MapArg3[In1 any, In2 any, In3 any, Out3 any](f func(In3) Out3) func(either mo.Either3[In1, In2, In3]) mo.Either3[In1, In2, Out3]

MapArg3 executes the given function, if Either3 use the third argument, and returns result.

func Match

func Match[In1 any, In2 any, In3 any, Out1 any, Out2 any, Out3 any](onArg1 func(In1) Out1, onArg2 func(In2) Out2, onArg3 func(In3) Out3) func(either mo.Either3[In1, In2, In3]) mo.Either3[Out1, Out2, Out3]

Match returns the result of applying `onLeft` to the left value of the either or `onRight` to the right value of the either.

func Pipe1

func Pipe1[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
) mo.Either3[B1, B2, B3]

func Pipe10

func Pipe10[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any, G1 any, G2 any, G3 any, H1 any, H2 any, H3 any, I1 any, I2 any, I3 any, J1 any, J2 any, J3 any, K1 any, K2 any, K3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
	operator6 func(mo.Either3[F1, F2, F3]) mo.Either3[G1, G2, G3],
	operator7 func(mo.Either3[G1, G2, G3]) mo.Either3[H1, H2, H3],
	operator8 func(mo.Either3[H1, H2, H3]) mo.Either3[I1, I2, I3],
	operator9 func(mo.Either3[I1, I2, I3]) mo.Either3[J1, J2, J3],
	operator10 func(mo.Either3[J1, J2, J3]) mo.Either3[K1, K2, K3],
) mo.Either3[K1, K2, K3]

func Pipe2

func Pipe2[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
) mo.Either3[C1, C2, C3]

func Pipe3

func Pipe3[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
) mo.Either3[D1, D2, D3]

func Pipe4

func Pipe4[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
) mo.Either3[E1, E2, E3]

func Pipe5

func Pipe5[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
) mo.Either3[F1, F2, F3]

func Pipe6

func Pipe6[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any, G1 any, G2 any, G3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
	operator6 func(mo.Either3[F1, F2, F3]) mo.Either3[G1, G2, G3],
) mo.Either3[G1, G2, G3]

func Pipe7

func Pipe7[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any, G1 any, G2 any, G3 any, H1 any, H2 any, H3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
	operator6 func(mo.Either3[F1, F2, F3]) mo.Either3[G1, G2, G3],
	operator7 func(mo.Either3[G1, G2, G3]) mo.Either3[H1, H2, H3],
) mo.Either3[H1, H2, H3]

func Pipe8

func Pipe8[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any, G1 any, G2 any, G3 any, H1 any, H2 any, H3 any, I1 any, I2 any, I3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
	operator6 func(mo.Either3[F1, F2, F3]) mo.Either3[G1, G2, G3],
	operator7 func(mo.Either3[G1, G2, G3]) mo.Either3[H1, H2, H3],
	operator8 func(mo.Either3[H1, H2, H3]) mo.Either3[I1, I2, I3],
) mo.Either3[I1, I2, I3]

func Pipe9

func Pipe9[A1 any, A2 any, A3 any, B1 any, B2 any, B3 any, C1 any, C2 any, C3 any, D1 any, D2 any, D3 any, E1 any, E2 any, E3 any, F1 any, F2 any, F3 any, G1 any, G2 any, G3 any, H1 any, H2 any, H3 any, I1 any, I2 any, I3 any, J1 any, J2 any, J3 any](
	source mo.Either3[A1, A2, A3],
	operator1 func(mo.Either3[A1, A2, A3]) mo.Either3[B1, B2, B3],
	operator2 func(mo.Either3[B1, B2, B3]) mo.Either3[C1, C2, C3],
	operator3 func(mo.Either3[C1, C2, C3]) mo.Either3[D1, D2, D3],
	operator4 func(mo.Either3[D1, D2, D3]) mo.Either3[E1, E2, E3],
	operator5 func(mo.Either3[E1, E2, E3]) mo.Either3[F1, F2, F3],
	operator6 func(mo.Either3[F1, F2, F3]) mo.Either3[G1, G2, G3],
	operator7 func(mo.Either3[G1, G2, G3]) mo.Either3[H1, H2, H3],
	operator8 func(mo.Either3[H1, H2, H3]) mo.Either3[I1, I2, I3],
	operator9 func(mo.Either3[I1, I2, I3]) mo.Either3[J1, J2, J3],
) mo.Either3[J1, J2, J3]

Types

This section is empty.

Jump to

Keyboard shortcuts

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