generic

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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 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 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 MakeBy

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

MakeBy returns an [Iterator] with `n` 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 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 Replicate

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

Replicate creates an [Iterator] containing a value repeated the specified number of times.

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