set

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package set provides mutable github.com/m4gshm/gollections/collection/ordered.Set constructors and helpers

Index

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)) 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 *ordered.Set[From], converter func(From) To) seq.Seq[To]

Convert returns a seq that applies the 'converter' function to the collection elements

func Empty

func Empty[T comparable]() *ordered.Set[T]

Empty instantiates Set with zero capacity.

func Flat

func Flat[From, To comparable](set *ordered.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 *ordered.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]) *ordered.Set[T]

FromSeq creates a set with elements retrieved by the seq.

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 cmp.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.

Jump to

Keyboard shortcuts

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