Documentation
¶
Overview ¶
Package set provides unordered mutable.Set constructors and helpers
Index ¶
- func Conv[From, To comparable](set *mutable.Set[From], converter func(From) (To, error)) breakStream.Iter[To]
- func Convert[From, To comparable](set *mutable.Set[From], converter func(From) To) stream.Iter[To]
- func Empty[T comparable]() *mutable.Set[T]
- func Flat[From, To comparable](set *mutable.Set[From], flattener func(From) []To) stream.Iter[To]
- func Flatt[From, To comparable](set *mutable.Set[From], flattener func(From) ([]To, error)) breakStream.Iter[To]
- func From[T comparable](next func() (T, bool)) *mutable.Set[T]
- func NewCap[T comparable](capacity int) *mutable.Set[T]
- func Of[T comparable](elements ...T) *mutable.Set[T]
- func Sort[T comparable, F constraints.Ordered](s *mutable.Set[T], by func(T) F) *ordered.Set[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Conv ¶
func Conv[From, To comparable](set *mutable.Set[From], converter func(From) (To, error)) breakStream.Iter[To]
Conv returns a breakable stream that applies the 'converter' function to the collection elements
func Convert ¶
func Convert[From, To comparable](set *mutable.Set[From], converter func(From) To) stream.Iter[To]
Convert returns a stream that applies the 'converter' function to the collection elements
func Flat ¶
func Flat[From, To comparable](set *mutable.Set[From], flattener func(From) []To) stream.Iter[To]
Flat returns a stream that converts the collection elements into slices and then flattens them to one level
func Flatt ¶
func Flatt[From, To comparable](set *mutable.Set[From], flattener func(From) ([]To, error)) breakStream.Iter[To]
Flatt returns a breakable stream that converts the collection elements into slices and then flattens them to one level
func From ¶
func From[T comparable](next func() (T, bool)) *mutable.Set[T]
From instantiates a set with elements retrieved by the 'next' function
func NewCap ¶
func NewCap[T comparable](capacity int) *mutable.Set[T]
NewCap instantiates Set with a predefined capacity.
func Of ¶
func Of[T comparable](elements ...T) *mutable.Set[T]
Of instantiates Set with predefined elements.
func Sort ¶
func Sort[T comparable, F constraints.Ordered](s *mutable.Set[T], by func(T) F) *ordered.Set[T]
Sort sorts a Set in-place by a converter that thransforms an element to an Ordered (int, string and so on).
Types ¶
This section is empty.