Documentation
¶
Overview ¶
Package set provides unordered github.com/m4gshm/gollections/collection/immutable.Set constructors and helpers
Index ¶
- func Conv[From, To comparable](set immutable.Set[From], converter func(From) (To, error)) seq.SeqE[To]
- func Convert[From, To comparable](set immutable.Set[From], converter func(From) To) seq.Seq[To]
- func Flat[From, To comparable](set immutable.Set[From], flattener func(From) []To) seq.Seq[To]
- func Flatt[From, To comparable](set immutable.Set[From], flattener func(From) ([]To, error)) seq.SeqE[To]
- func FromSeq[T comparable](seq seq.Seq[T]) immutable.Set[T]
- func New[T comparable](elements []T) immutable.Set[T]
- func Of[T comparable](elements ...T) immutable.Set[T]
- func Sort[T comparable, f cmp.Ordered](s immutable.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 immutable.Set[From], converter func(From) (To, error)) seq.SeqE[To]
Conv returns an errorable seq that applies the 'converter' function to the collection elements
func Convert ¶
func Convert[From, To comparable](set immutable.Set[From], converter func(From) To) seq.Seq[To]
Convert returns a seq that applies the 'converter' function to the collection elements
func Flat ¶
func Flat[From, To comparable](set immutable.Set[From], flattener func(From) []To) seq.Seq[To]
Flat returns a seq that converts the collection elements into slices and then flattens them to one level
func Flatt ¶
func Flatt[From, To comparable](set immutable.Set[From], flattener func(From) ([]To, error)) seq.SeqE[To]
Flatt returns an errorable seq that converts the collection elements into slices and then flattens them to one level
func FromSeq ¶ added in v0.0.15
func FromSeq[T comparable](seq seq.Seq[T]) immutable.Set[T]
FromSeq creates a set with elements retrieved by the seq.
func New ¶
func New[T comparable](elements []T) immutable.Set[T]
New instantiates Set and copies elements to it.
func Of ¶
func Of[T comparable](elements ...T) immutable.Set[T]
Of instantiates Set with predefined elements.
Types ¶
This section is empty.