generic

package
v1.0.77 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any added in v1.0.55

func Any[GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) bool, U any](pred FCT) func(ma GU) bool

Any returns `true` if any element of the iterable is `true`. If the iterable is empty, return `false`

func Ap added in v1.0.7

func Ap[GUV ~func() O.Option[T.Tuple2[GUV, func(U) V]], GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](ma GU) func(fab GUV) GV

func Chain

func Chain[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](f func(U) GV) func(GU) GV

func Compress added in v1.0.13

func Compress[GU ~func() O.Option[T.Tuple2[GU, U]], GB ~func() O.Option[T.Tuple2[GB, bool]], CS ~func() O.Option[T.Tuple2[CS, T.Tuple2[U, bool]]], U any](sel GB) func(GU) GU

Compress returns an [Iterator] that filters elements from a data [Iterator] returning only those that have a corresponding element in selector [Iterator] that evaluates to `true`. Stops when either the data or selectors iterator has been exhausted.

func Count added in v1.0.13

func Count[GU ~func() O.Option[T.Tuple2[GU, int]]](start int) GU

Count creates an [Iterator] containing a consecutive sequence of integers starting with the provided start value

func Current added in v1.0.55

func Current[GU ~func() O.Option[T.Tuple2[GU, U]], U any](m T.Tuple2[GU, U]) U

Current returns the current element in an iterator `T.Tuple2`

func Cycle added in v1.0.13

func Cycle[GU ~func() O.Option[T.Tuple2[GU, U]], U any](ma GU) GU

func DropWhile added in v1.0.13

func DropWhile[GU ~func() O.Option[T.Tuple2[GU, U]], U any](pred func(U) bool) func(GU) GU

DropWhile creates an [Iterator] that drops elements from the [Iterator] as long as the predicate is true; afterwards, returns every element. Note, the [Iterator] does not produce any output until the predicate first becomes false

func Empty

func Empty[GU ~func() O.Option[T.Tuple2[GU, U]], U any]() GU

Empty returns the empty iterator

func Filter added in v1.0.7

func Filter[GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) bool, U any](f FCT) func(ma GU) GU

func FilterChain added in v1.0.15

func FilterChain[GVV ~func() O.Option[T.Tuple2[GVV, GV]], GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) O.Option[GV], U, V any](f FCT) func(ma GU) GV

func FilterMap added in v1.0.7

func FilterMap[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) O.Option[V], U, V any](f FCT) func(ma GU) GV

func First added in v1.0.14

func First[GU ~func() O.Option[T.Tuple2[GU, U]], U any](mu GU) O.Option[U]

First returns the first item in an iterator if such an item exists

func Flatten

func Flatten[GV ~func() O.Option[T.Tuple2[GV, GU]], GU ~func() O.Option[T.Tuple2[GU, U]], U any](ma GV) GU

func Fold added in v1.0.16

func Fold[GU ~func() O.Option[T.Tuple2[GU, U]], U any](m M.Monoid[U]) func(ma GU) U

func FoldMap added in v1.0.16

func FoldMap[GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) V, U, V any](m M.Monoid[V]) func(FCT) func(ma GU) V

func From

func From[GU ~func() O.Option[T.Tuple2[GU, U]], U any](data ...U) GU

From constructs an array from a set of variadic arguments

func FromArray

func FromArray[GU ~func() O.Option[T.Tuple2[GU, U]], US ~[]U, U any](as US) GU

FromArray returns an iterator from multiple elements

func FromReflect added in v1.0.20

func FromReflect[GR ~func() O.Option[T.Tuple2[GR, R.Value]]](val R.Value) GR

func Last added in v1.0.14

func Last[GU ~func() O.Option[T.Tuple2[GU, U]], U any](mu GU) O.Option[U]

Last returns the last item in an iterator if such an item exists

func MakeBy

func MakeBy[GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(int) U, U any](f FCT) GU

MakeBy returns an [Iterator] with an infinite number of elements initialized with `f(i)`

func Map

func Map[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(U) V, U, V any](f FCT) func(ma GU) GV

func MonadAp added in v1.0.7

func MonadAp[GUV ~func() O.Option[T.Tuple2[GUV, func(U) V]], GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](fab GUV, ma GU) GV

func MonadChain

func MonadChain[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](ma GU, f func(U) GV) GV

func MonadMap

func MonadMap[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](ma GU, f func(U) V) GV

func Monoid

func Monoid[GU ~func() O.Option[T.Tuple2[GU, U]], U any]() M.Monoid[GU]

func Next added in v1.0.55

func Next[GU ~func() O.Option[T.Tuple2[GU, U]], U any](m T.Tuple2[GU, U]) GU

Next returns the iterator for the next element in an iterator `T.Tuple2`

func Of

func Of[GU ~func() O.Option[T.Tuple2[GU, U]], U any](a U) GU

Of returns an iterator with one single element

func Reduce

func Reduce[GU ~func() O.Option[T.Tuple2[GU, U]], U, V any](f func(V, U) V, initial V) func(GU) V

Reduce applies a function for each value of the iterator with a floating result

func Repeat added in v1.0.13

func Repeat[GU ~func() O.Option[T.Tuple2[GU, U]], U any](n int, a U) GU

Repeat creates an [Iterator] containing a value repeated the specified number of times. Alias of Replicate combined with Take

func Replicate

func Replicate[GU ~func() O.Option[T.Tuple2[GU, U]], U any](a U) GU

Replicate creates an infinite [Iterator] containing a value.

func Scan added in v1.0.12

func Scan[GV ~func() O.Option[T.Tuple2[GV, V]], GU ~func() O.Option[T.Tuple2[GU, U]], FCT ~func(V, U) V, U, V any](f FCT, initial V) func(ma GU) GV

func StrictUniq added in v1.0.11

func StrictUniq[AS ~func() O.Option[T.Tuple2[AS, A]], A comparable](as AS) AS

func Take added in v1.0.12

func Take[GU ~func() O.Option[T.Tuple2[GU, U]], U any](n int) func(ma GU) GU

func ToArray

func ToArray[GU ~func() O.Option[T.Tuple2[GU, U]], US ~[]U, U any](u GU) US

ToArray converts the iterator to an array

func Uniq added in v1.0.11

func Uniq[AS ~func() O.Option[T.Tuple2[AS, A]], K comparable, A any](f func(A) K) func(as AS) AS

func Zip added in v1.0.11

func Zip[AS ~func() O.Option[T.Tuple2[AS, A]], BS ~func() O.Option[T.Tuple2[BS, B]], CS ~func() O.Option[T.Tuple2[CS, T.Tuple2[A, B]]], A, B any](fb BS) func(AS) CS

Zip takes two iterators and returns an iterators of corresponding pairs. If one input iterators is short, excess elements of the longer iterator are discarded

func ZipWith added in v1.0.11

func ZipWith[AS ~func() O.Option[T.Tuple2[AS, A]], BS ~func() O.Option[T.Tuple2[BS, B]], CS ~func() O.Option[T.Tuple2[CS, C]], FCT ~func(A, B) C, A, B, C any](fa AS, fb BS, f FCT) CS

ZipWith applies a function to pairs of elements at the same index in two iterators, collecting the results in a new iterator. If one input iterator is short, excess elements of the longer iterator are discarded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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