Documentation
¶
Overview ¶
Package either implements a simple generic "Either" type that can represent exactly one value out of two options.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type E ¶
E represents a type that can hold either a value "a" of type A or a value "b" of type B.
func Pack ¶
Pack returns an E that contains eotjer a value "a" of type A (if index == 'a'), a value "b" of type B (if index == 'b'), or panics if index is not 'a' or 'b'.
func (E[A, B]) A ¶
A returns the value "a" of type A and true if the E contains that value, or the zero value and false otherwise.
Click to show internal directories.
Click to hide internal directories.