Documentation ¶
Overview ¶
Package set provides ordered.Set constructors and helpers
Index ¶
- func Conv[From, To comparable](set ordered.Set[From], converter func(From) (To, error)) breakStream.Iter[To]
- func Convert[From, To comparable](set ordered.Set[From], converter func(From) To) stream.Iter[To]
- func Flat[From, To comparable](set ordered.Set[From], flattener func(From) ([]To, error)) breakStream.Iter[To]
- func Flatt[From, To comparable](set ordered.Set[From], flattener func(From) []To) stream.Iter[To]
- func From[T comparable](next func() (T, bool)) ordered.Set[T]
- func New[T comparable](elements []T) ordered.Set[T]
- func Of[T comparable](elements ...T) ordered.Set[T]
- func Sort[T comparable, f constraints.Ordered](s ordered.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 ordered.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 ordered.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 ordered.Set[From], flattener func(From) ([]To, error)) breakStream.Iter[To]
Flat returns a breakable stream that converts the collection elements into slices and then flattens them to one level
func Flatt ¶
func Flatt[From, To comparable](set ordered.Set[From], flattener func(From) []To) stream.Iter[To]
Flatt returns a 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)) ordered.Set[T]
From instantiates a set with elements retrieved by the 'next' function
func New ¶
func New[T comparable](elements []T) ordered.Set[T]
New instantiates Set and copies elements to it.
func Of ¶
func Of[T comparable](elements ...T) ordered.Set[T]
Of instantiates Set with predefined elements.
func Sort ¶
func Sort[T comparable, f constraints.Ordered](s ordered.Set[T], by func(T) f) ordered.Set[T]
Sort copy the specified set with sorted elements
Types ¶
This section is empty.