singleton package - github.com/phelmkamp/valor/tuple/singleton - Go Packages (original) (raw)
Package singleton provides a singleton set.
package main
import ( "fmt" "github.com/phelmkamp/valor/tuple/singleton" )
func main() { fmt.Println(singleton.SetOf(42)) }
Output:
{42}
func SetUnzip[T, T2 any](t two.Tuple[T, T2]) (Set[T], Set[T2])
func SetZip[T, T2 any](s Set[T], s2 Set[T2]) two.Tuple[T, T2]
This section is empty.
This section is empty.
SetUnzip separates the values of t into two Sets.
SetZip combines the values of s and s2 into a two.Tuple.
Set contains at most one element.
It works like a map. Use the key unit.Unit to access the element:
v, ok := s[unit.Unit]
SetOf creates a Set of v.
String returns the Set formatted as a string.