pair

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach[K, V any](seq Seq[K, V], f func(K, V) error) error

ForEach applies clojure on iterator

func ToSeq added in v0.2.0

func ToSeq[K1, V1, V2 any](lhs Seq[K1, V1], rhs func(K1, V1) seq.Seq[V2]) seq.Seq[V2]

Left join sequence of pairs to sequence of values

Types

type Seq

type Seq[K, V any] interface {
	seq.Seq[V]
	Key() K
}

Generic Sequence of Pairs

seq := createSeq()
for has := seq != nil; has; has = seq.Next() {
	seq.Value()
}

func DropWhile

func DropWhile[K, V any](seq Seq[K, V], f func(K, V) bool) Seq[K, V]

Drop values from iterator while predicate function true

func Filter

func Filter[K, V any](seq Seq[K, V], f func(K, V) bool) Seq[K, V]

Filter values from iterator

func From

func From[K, V any](key K, val V) Seq[K, V]

Lift instance of T into Seq[T] trait

func FromSeq added in v0.2.0

func FromSeq[K1, K2, V2 any](lhs seq.Seq[K1], rhs func(K1) Seq[K2, V2]) Seq[K2, V2]

Left join sequence of elements to sequence of pairs

func Join

func Join[K1, K2, V1, V2 any](lhs Seq[K1, V1], rhs func(K1, V1) Seq[K2, V2]) Seq[K2, V2]

Left join

func Map

func Map[K, A, B any](seq Seq[K, A], f func(K, A) B) Seq[K, B]

FMap transform iterator type

func Plus

func Plus[K, V any](lhs, rhs Seq[K, V]) Seq[K, V]

Plus operation for iterators add one after another

func TakeWhile

func TakeWhile[K, V any](seq Seq[K, V], f func(K, V) bool) Seq[K, V]

Take values from iterator while predicate function true

Jump to

Keyboard shortcuts

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