set

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package set provides unordered immutable.Set constructors and helpers

Index

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)) 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 immutable.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 immutable.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 immutable.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)) immutable.Set[T]

From instantiates a map with key/values retrieved by the 'next' function. The next returns a key/value pairs with true or zero values with false if there are no more elements.

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.

func Sort

func Sort[T comparable, f constraints.Ordered](s immutable.Set[T], by func(T) f) ordered.Set[T]

Sort instantiates Set and puts sorted elements to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL