tuple

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 0 Imported by: 0

README

Tuple

For when all you need is a tuple, why not simply use a tuple. Say goodbye to all the in place, use once, struggling to name structs.

How to use

have a look at the tests. It's very straight forward.

t := T(1,2)

if f.First == 1 {
    fmt.Println("you just accessed the first element")
}

if f.First == 2 {
    fmt.Println("you just accessed the second element")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tuple

type Tuple[A any, B any] struct {
	First  A
	Second B
}

func T

func T[A any, B any](a A, b B) Tuple[A, B]

Jump to

Keyboard shortcuts

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