package
2.2.0
Repository: https://github.com/booleancat/go-functional.git
Documentation: pkg.go.dev

# Packages

This package contains functions intended for use with [iter.Filter].
No description provided by the author
No description provided by the author

# Functions

All consumes an [iter.Seq] of `bool`s and returns true if all values are true, or false otherwise.
All consumes an [iter.Seq] of `bool`s and returns true if any of the values are true, or false otherwise.
Chain yields values from multiple iterators in sequence.
Chain2 yields values from multiple iterators in sequence.
Collect2 consumes an [iter.Seq2] and returns two slices of values.
Contains consumes an [iter.Seq] until the provided value is found and returns true.
Cycle yields values from an iterator repeatedly.
Cycle2 yields pairs of values from an iterator repeatedly.
Drain consumes an [iter.Seq] completely, dropping all values.
Drain2 consumes an [iter.Seq2] completely, dropping all values.
Drop yields all values from a delegate iterator except the first `count` values.
Drop2 yields all pairs of values from a delegate iterator except the first `count` pairs.
DropWhile yields all values from a delegate iterator after the predicate returns false.
DropWhile2 yields all pairs of values from a delegate iterator after the predicate returns false.
Enumerate yields pairs of indices and values from an iterator.
Exclude yields values from an iterator that do not satisfy a predicate.
Exclude2 yields values from an iterator that do not satisfy a predicate.
ExcludeError yields values from an iterator that do not satisfy a predicate where the predicate can return an error.
Exhausted is an iterator that yields no values.
Exhausted2 is an iterator that yields no values.
Filter yields values from an iterator that satisfy a predicate.
Filter2 yields values from an iterator that satisfy a predicate.
FilterError yields values from an iterator that satisfy a predicate where the predicate can return an error.
Find consumes an iterator until a value is found that satisfies a predicate.
Find2 consumes an iterator until a pair of values is found that satisfies a predicate.
Fold will fold every element into an accumulator by applying a function and passing an initial value.
Fold2 will fold every element into an accumulator by applying a function and passing an initial value.
ForEach consumes an iterator and applies a function to each value yielded.
ForEach2 consumes an iterator and applies a function to each pair of values.
FromChannel yields values from a channel.
Integers yields all integers in the range [start, stop) with the given step.
Left is a convenience function that unzips an iterator and returns the left iterator, closing the right iterator.
Len consumes an [iter.Seq] and returns the number of values yielded.
Len2 consumes an [iter.Seq2] and returns the number of pairs of values yielded.
Lines yields lines from an io.Reader.
LinesString yields lines from an io.Reader as strings.
Map yields values from an iterator that have had the provided function applied to each value.
Map2 yields pairs of values from an iterator that have had the provided function applied to each pair.
MapError yields values from an iterator that have had the provided function applied to each value where the function can return an error.
Max consumes an iterator and returns the maximum value yielded and true if there was at least one value, or the zero value and false if the iterator was empty.
Min consumes an iterator and returns the minimum value yielded and true if there was at least one value, or the zero value and false if the iterator was empty.
MustCollect consumes an [iter.Seq2] where the right side yields errors and returns a slice of values.
NaturalNumbers yields all non-negative integers in ascending order.
Once yields the provided value once.
Once2 yields the provided value pair once.
Repeat yields the same value indefinitely.
Repeat2 yields the same two values indefinitely.
Right is a convenience function that unzips an iterator and returns the right iterator, closing the left iterator.
Take yields the first `limit` values from a delegate iterator.
Take2 yields the first `limit` pairs of values from a delegate iterator.
TakeWhile yields values from a delegate iterator until the predicate returns false.
TakeWhile2 yields pairs of values from a delegate iterator until the predicate returns false.
ToChannel sends yielded values to a channel.
TryCollect consumes an [iter.Seq2] where the right side yields errors and returns a slice of values and the first error encountered.
Zip yields pairs of values from two iterators.