lazy

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run1

func Run1[V any](hm Hermit[V]) (V, error)

func Run10

func Run10[S, T1, T2, T3, T4, T5, T6, T7, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, U], cs Consumer[U, V]) (V, error)

func Run11

func Run11[S, T1, T2, T3, T4, T5, T6, T7, T8, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, T8], ps9 Prosumer[T8, U], cs Consumer[U, V]) (V, error)

func Run12

func Run12[S, T1, T2, T3, T4, T5, T6, T7, T8, T9, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, T8], ps9 Prosumer[T8, T9], ps10 Prosumer[T9, U], cs Consumer[U, V]) (V, error)

func Run2

func Run2[S, V any](pd Producer[S], cs Consumer[S, V]) (V, error)

func Run3

func Run3[S, U, V any](pd Producer[S], ps1 Prosumer[S, U], cs Consumer[U, V]) (V, error)

func Run4

func Run4[S, T1, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, U], cs Consumer[U, V]) (V, error)

func Run5

func Run5[S, T1, T2, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, U], cs Consumer[U, V]) (V, error)

func Run6

func Run6[S, T1, T2, T3, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, U], cs Consumer[U, V]) (V, error)

func Run7

func Run7[S, T1, T2, T3, T4, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, U], cs Consumer[U, V]) (V, error)

func Run8

func Run8[S, T1, T2, T3, T4, T5, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, U], cs Consumer[U, V]) (V, error)

func Run9

func Run9[S, T1, T2, T3, T4, T5, T6, U, V any](pd Producer[S], ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, U], cs Consumer[U, V]) (V, error)

Types

type Consumer

type Consumer[S, T any] struct {
	machine.Machine[S, Void, T]
}

func All

func All[T any](p func(T) bool) Consumer[T, bool]

func And

func And() Consumer[bool, bool]

func Any

func Any[T any](p func(T) bool) Consumer[T, bool]

func ChainCS

func ChainCS[S, T, U any](ps Prosumer[S, T], cs Consumer[T, U]) Consumer[S, U]

func Count

func Count[T any]() Consumer[T, int]

func First

func First[T any]() Consumer[T, T]

func ForEach

func ForEach[T any](f func(T)) Consumer[T, Void]

func Includes

func Includes[T constraints.Ordered](x T) Consumer[T, bool]

func IsEmpty

func IsEmpty[T any]() Consumer[T, bool]

func Last

func Last[T any]() Consumer[T, T]

func Max

func Max[T constraints.Ordered]() Consumer[T, T]

func Min

func Min[T constraints.Ordered]() Consumer[T, T]

func NewConsumer

func NewConsumer[S, T any](m machine.Machine[S, Void, T]) Consumer[S, T]

func Nth

func Nth[T any](n int) Consumer[T, T]

func Or

func Or() Consumer[bool, bool]

func Product

func Product() Consumer[int, int]

func ProductFloat

func ProductFloat[T constraints.Float]() Consumer[T, T]

func ProductInteger

func ProductInteger[T constraints.Integer]() Consumer[T, T]

func Redirect

func Redirect[R, S, T any](cs1 Consumer[R, S], cs2 Consumer[error, T]) Consumer[R, tuple.Tuple2[S, T]]

func RedirectWith

func RedirectWith[R, S, T, U any](cs1 Consumer[R, S], cs2 Consumer[error, T], f func(S, T) U) Consumer[R, U]

func Reduce

func Reduce[S, T any](x T, f func(T, S) T) Consumer[S, T]

func Reduce1

func Reduce1[T any](f func(T, T) T) Consumer[T, T]

func Spark

func Spark[S, T1, T2 any](cs1 Consumer[S, T1], cs2 Consumer[S, T2]) Consumer[S, tuple.Tuple2[T1, T2]]

func SparkWith

func SparkWith[S, T1, T2, U any](cs1 Consumer[S, T1], cs2 Consumer[S, T2], f func(T1, T2) U) Consumer[S, U]

func Sum

func Sum() Consumer[int, int]

func SumFloat

func SumFloat[T constraints.Float]() Consumer[T, T]

func SumInteger

func SumInteger[T constraints.Integer]() Consumer[T, T]

func ToSlice

func ToSlice[T any]() Consumer[T, []T]

type Hermit

type Hermit[T any] struct {
	machine.Machine[Void, Void, T]
}

func ChainHM

func ChainHM[S, T any](pd Producer[S], cs Consumer[S, T]) Hermit[T]

func NewHermit

func NewHermit[T any](m machine.Machine[Void, Void, T]) Hermit[T]

type Producer

type Producer[T any] struct {
	machine.Machine[Void, T, Void]
}

func ChainPD

func ChainPD[S, T any](pd Producer[S], ps Prosumer[S, T]) Producer[T]

func CycleSlice

func CycleSlice[T any](xs []T) Producer[T]

func FlatMap

func FlatMap[S, T any](pd Producer[S], f func(S) Producer[T]) Producer[T]

func Flatten

func Flatten[T any](pd Producer[Producer[T]]) Producer[T]

func FromSlice

func FromSlice[T any](xs []T) Producer[T]

func Iterate

func Iterate[T any](x T, f func(T) T) Producer[T]

func NewProducer

func NewProducer[T any](m machine.Machine[Void, T, Void]) Producer[T]

func Once

func Once[T any](x T) Producer[T]

func Range

func Range(stop int) Producer[int]

func RangeBy

func RangeBy(start, stop, step int) Producer[int]

func RangeFloat

func RangeFloat[T constraints.Float](stop T) Producer[T]

func RangeFloatBy

func RangeFloatBy[T constraints.Float](start, stop, step T) Producer[T]

func RangeFloatTo

func RangeFloatTo[T constraints.Float](start, stop T) Producer[T]

func RangeInteger

func RangeInteger[T constraints.Integer](stop T) Producer[T]

func RangeIntegerBy

func RangeIntegerBy[T constraints.Integer](start, stop, step T) Producer[T]

func RangeIntegerTo

func RangeIntegerTo[T constraints.Integer](start, stop T) Producer[T]

func RangeTo

func RangeTo(start, stop int) Producer[int]

func Repeat

func Repeat[T any](x T) Producer[T]

func Replicate

func Replicate[T any](n int, x T) Producer[T]

func ThrowOnce

func ThrowOnce[T any](err error) Producer[T]

func Zip

func Zip[T1, T2 any](pd1 Producer[T1], pd2 Producer[T2]) Producer[tuple.Tuple2[T1, T2]]

func Zip3

func Zip3[T1, T2, T3 any](pd1 Producer[T1], pd2 Producer[T2], pd3 Producer[T3]) Producer[tuple.Tuple3[T1, T2, T3]]

func ZipWith

func ZipWith[T1, T2, T3 any](pd1 Producer[T1], pd2 Producer[T2], f func(T1, T2) T3) Producer[T3]

func ZipWith3

func ZipWith3[T1, T2, T3, U any](pd1 Producer[T1], pd2 Producer[T2], pd3 Producer[T3], f func(T1, T2, T3) U) Producer[U]

type Prosumer

type Prosumer[S, T any] struct {
	machine.Machine[S, T, Void]
}

func BreakIfErr

func BreakIfErr[T any]() Prosumer[T, T]

func Chain10

func Chain10[S, T1, T2, T3, T4, T5, T6, T7, T8, T9, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, T8], ps9 Prosumer[T8, T9], ps10 Prosumer[T9, U]) Prosumer[S, U]

func Chain2

func Chain2[S, T1, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, U]) Prosumer[S, U]

func Chain3

func Chain3[S, T1, T2, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, U]) Prosumer[S, U]

func Chain4

func Chain4[S, T1, T2, T3, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, U]) Prosumer[S, U]

func Chain5

func Chain5[S, T1, T2, T3, T4, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, U]) Prosumer[S, U]

func Chain6

func Chain6[S, T1, T2, T3, T4, T5, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, U]) Prosumer[S, U]

func Chain7

func Chain7[S, T1, T2, T3, T4, T5, T6, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, U]) Prosumer[S, U]

func Chain8

func Chain8[S, T1, T2, T3, T4, T5, T6, T7, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, U]) Prosumer[S, U]

func Chain9

func Chain9[S, T1, T2, T3, T4, T5, T6, T7, T8, U any](ps1 Prosumer[S, T1], ps2 Prosumer[T1, T2], ps3 Prosumer[T2, T3], ps4 Prosumer[T3, T4], ps5 Prosumer[T4, T5], ps6 Prosumer[T5, T6], ps7 Prosumer[T6, T7], ps8 Prosumer[T7, T8], ps9 Prosumer[T8, U]) Prosumer[S, U]

func Concat

func Concat[T any]() Prosumer[Producer[T], T]

func ConcatMap

func ConcatMap[S, T any](f func(S) Producer[T]) Prosumer[S, T]

func Drop

func Drop[T any](n int) Prosumer[T, T]

func DropWhile

func DropWhile[T any](p func(T) bool) Prosumer[T, T]

func Filter

func Filter[T any](p func(T) bool) Prosumer[T, T]

func IgnoreErr

func IgnoreErr[T any]() Prosumer[T, T]

func Map

func Map[S, T any](f func(S) T) Prosumer[S, T]

func NewProsumer

func NewProsumer[S, T any](m machine.Machine[S, T, Void]) Prosumer[S, T]

func Reverse

func Reverse[T any]() Prosumer[T, T]

func Scan

func Scan[S, T any](x T, f func(T, S) T) Prosumer[S, T]

func Scan1

func Scan1[T any](f func(T, T) T) Prosumer[T, T]

func Take

func Take[T any](n int) Prosumer[T, T]

func TakeWhile

func TakeWhile[T any](p func(T) bool) Prosumer[T, T]

func TryFilter

func TryFilter[T any](p func(T) error) Prosumer[T, T]

func TryMap

func TryMap[S, T any](f func(S) (T, error)) Prosumer[S, T]

type Void

type Void = machine.Void

Jump to

Keyboard shortcuts

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