Discover Packages
github.com/bantling/micro
tuple
package
Version:
v0.0.0-...-02bf512
Opens a new window with list of versions in this module.
Published: Apr 29, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package tuple provides simple tuple implementations
SPDX-License-Identifier: Apache-2.0
type Four
func Of4[T, U, V, W any](t T, u U, v V, w W) Four[T, U, V, W]
func Of4Same[T any](t T, u T, v T, w T) Four[T, T, T, T]
type Three
func Of3[T, U, V any](t T, u U, v V) Three[T, U, V]
func Of3Same[T any](t T, u T, v T) Three[T, T, T]
type Two
type Four[T, U, V, W any ] struct {
T T
U U
V V
W W
}
Four is analogous to Two, but with four values, where the last value might be an error
func Of4[T, U, V, W any ](t T, u U, v V, w W) Four [T, U, V, W]
func Of4Same[T any ](t T, u T, v T, w T) Four [T, T, T, T]
String is the Stringer interface for Four
func (t Four [T, U, V, W]) Values() (T, U, V, W)
type Three[T, U, V any ] struct {
T T
U U
V V
}
Three is analogous to Two, but with three values, where the last value might be an error
func Of3[T, U, V any ](t T, u U, v V) Three [T, U, V]
func Of3Same[T any ](t T, u T, v T) Three [T, T, T]
String is the Stringer interface for Three
func (t Three [T, U, V]) Values() (T, U, V)
type Two[T, U any ] struct {
T T
U U
}
Two is a tuple of two values for cases where it isn't worthwhile to declare your own struct.
Particularly useful for functions that need to return (T, error), they can instead return a single value Two[T, error]
func Of2[T, U any ](t T, u U) Two [T, U]
func Of2Same[T any ](t T, u T) Two [T, T]
String is the Stringer interface for Two
func (t Two [T, U]) Values() (T, U)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.