Documentation ¶
Overview ¶
Package vector provides ordered immutable.Vector constructors and helpers
Index ¶
- func Conv[From, To comparable](vector immutable.Vector[From], converter func(From) (To, error)) breakLoop.Loop[To]
- func Convert[From, To any](vector immutable.Vector[From], converter func(From) To) loop.Loop[To]
- func Flat[From any, To any](vector immutable.Vector[From], flattener func(From) []To) loop.Loop[To]
- func Flatt[From, To comparable](vector immutable.Vector[From], flattener func(From) ([]To, error)) breakLoop.Loop[To]
- func From[T any](next func() (T, bool)) immutable.Vector[T]
- func New[T any](elements []T) immutable.Vector[T]
- func Of[T any](elements ...T) immutable.Vector[T]
- func Sort[T any, F constraints.Ordered](v immutable.Vector[T], by func(T) F) immutable.Vector[T]
- func Wrap[T any](elements []T) immutable.Vector[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Conv ¶
func Conv[From, To comparable](vector immutable.Vector[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 ¶
Convert returns a loop that applies the 'converter' function to the collection elements
func Flat ¶
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](vector immutable.Vector[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 ¶
From instantiates a vector with elements retrieved by the 'next' function. The next returns an element with true or zero value with false if there are no more elements.
Types ¶
This section is empty.