chore: add mercury
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"go.sour.is/pkg/math"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
type Set[T comparable] map[T]struct{}
|
||||
@@ -33,6 +34,9 @@ func (s Set[T]) Delete(items ...T) Set[T] {
|
||||
}
|
||||
return s
|
||||
}
|
||||
func (s Set[T]) Values() []T {
|
||||
return maps.Keys(s)
|
||||
}
|
||||
|
||||
func (s Set[T]) Equal(e Set[T]) bool {
|
||||
for k := range s {
|
||||
|
||||
Reference in New Issue
Block a user