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 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址