Documentation
¶
Overview ¶
Package either provides a simple implementation of a sum type, Either, that can be either a Left or a Right.
Usage:
left := LeftOf[string](42) fmt.Println(left.Get()) // 42 right := RightOf[int]("foo") fmt.Println(right.Get()) // foo var either Either[int, string] = left either = right
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Either ¶
type Either[L, R any] interface { String() string GoString() string // contains filtered or unexported methods }
Either is a "sum type" that can be either Left or Right.
type Left ¶
type Left[L, R any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.