Documentation ¶
Overview ¶
Package set provides mutable ordered.Set constructors and helpers
Index ¶
- func Conv[From, To comparable](set *ordered.Set[From], converter func(From) (To, error)) breakLoop.Loop[To]
- func Convert[From, To comparable](set *ordered.Set[From], converter func(From) To) loop.Loop[To]
- func Empty[T comparable]() *ordered.Set[T]
- func Flat[From, To comparable](set *ordered.Set[From], flattener func(From) []To) loop.Loop[To]
- func Flatt[From, To comparable](set *ordered.Set[From], flattener func(From) ([]To, error)) breakLoop.Loop[To]
- func From[T comparable](next func() (T, bool)) *ordered.Set[T]
- func NewCap[T comparable](capacity int) *ordered.Set[T]
- func Of[T comparable](elements ...T) *ordered.Set[T]
- func Sort[T comparable, O constraints.Ordered](s *ordered.Set[T], by func(T) O) *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)) breakLoop.Loop[To]
Conv returns a breakable loop that applies the 'converter' function to the collection elements
func Convert ¶
func Convert[From, To comparable](set *ordered.Set[From], converter func(From) To) loop.Loop[To]
Convert returns a loop that applies the 'converter' function to the collection elements
func Flat ¶
func Flat[From, To comparable](set *ordered.Set[From], flattener func(From) []To) loop.Loop[To]
Flat returns a loop 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, error)) breakLoop.Loop[To]
Flatt returns a breakable loop 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 NewCap ¶
func NewCap[T comparable](capacity int) *ordered.Set[T]
NewCap instantiates Set with a predefined capacity.
func Of ¶
func Of[T comparable](elements ...T) *ordered.Set[T]
Of instantiates Set with predefined elements.
func Sort ¶ added in v0.0.8
func Sort[T comparable, O constraints.Ordered](s *ordered.Set[T], by func(T) O) *ordered.Set[T]
Sort copy the specified set with sorted elements
Types ¶
This section is empty.