Documentation
¶
Overview ¶
Package three provides a 3-tuple type.
Example ¶
package main
import (
"fmt"
"github.com/phelmkamp/valor/tuple/three"
)
func get() (string, int, float32, bool) {
return "a", 1, 1.0, true
}
func main() {
val := three.TupleValueOf(get())
fmt.Println(val)
}
Output: {{a 1 1} true}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TupleResultOf ¶
TupleResultOf creates a result.Result of either (v, v2, v3) or err. This aids interoperability with function return values.
Types ¶
type Tuple ¶
type Tuple[T, T2, T3 any] struct { V T V2 T2 V3 T3 }
Tuple contains three values.
func TupleMap ¶ added in v0.10.0
func TupleMap[T, T2, T3, Tp, T2p, T3p any](t Tuple[T, T2, T3], f func(T) Tp, f2 func(T2) T2p, f3 func(T3) T3p) Tuple[Tp, T2p, T3p]
TupleMap returns a Tuple with each value replaced by the result of each function.
funcs.Ident can be used to leave the value unchanged.
Click to show internal directories.
Click to hide internal directories.