Help us shape the future of Go! Take the 2026 Go Developer Survey

goset

package module
v0.0.0-...-ee0dcb4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 1 Imported by: 1

README

goset

goset is library with set calculation like sumset, intersection set.

goset runs only go1.18+.

install

go get -u github.com/azuki-bar/goset

License

this library is licensed under MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

func Difference[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T

Difference returns set difference calclated by aSlice - bSlice expressed by slice.

func Intersect

func Intersect[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T

Intersect returns intersection set expressed by slice. This function expressed by `aSlice and bSlice`.

func SetBy

func SetBy[T any, R comparable](slice []T, key func(key T) R) map[R]T

SetBy returns map structured by no duplicated elements.

func Sum

func Sum[T any, R comparable](aSlice, bSlice []T, key func(key T) R) []T

Sum returns set by sum. expressed by `a or b`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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