stream

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package stream implements a sequence of elements supporting sequential and parallel aggregate operations. this package is an experiment to explore if stream in go can work as the way java does. it's complete, but not powerful like other libs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat[T any](a, b stream[T]) stream[T]

Concat creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream.

func FromChannel

func FromChannel[T any](source <-chan T) stream[T]

FromChannel creates stream from channel.

func FromRange

func FromRange[T constraints.Integer | constraints.Float](start, end, step T) stream[T]

FromRange creates a number stream from start to end. both start and end are included. [start, end]

func FromSlice

func FromSlice[T any](source []T) stream[T]

FromSlice creates stream from slice.

func Generate

func Generate[T any](generator func() func() (item T, ok bool)) stream[T]

Generate stream where each element is generated by the provided generater function generater function: func() func() (item T, ok bool) {}

func Of

func Of[T any](elems ...T) stream[T]

Of creates a stream stream whose elements are the specified values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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