Documentation ¶
Index ¶
- func All(cb Callback, fs ...Func) bool
- func First(cb func(value interface{}), f Func) (ok bool)
- func ForPerm(n int, callback func(i int) (more bool)) bool
- func IterableAsSlice(it Iterable) (ret []interface{})
- func N(n int) []struct{}
- func NewIterator(it Iterable) (ret *iterator)
- func ToSlice(f Func) (ret []interface{})
- type Callback
- type Func
- type Group
- type Iterable
- type Iterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func First ¶ added in v1.3.0
Calls `cb` with the first value yielded by `f` and then stops iteration. `ok` if `cb` was called with a value.
func IterableAsSlice ¶
func IterableAsSlice(it Iterable) (ret []interface{})
func NewIterator ¶
func NewIterator(it Iterable) (ret *iterator)
Types ¶
type Callback ¶
type Callback func(value interface{}) (more bool)
Callback receives a value and returns true if another value should be received or false to stop iteration.
type Iterator ¶
type Iterator interface { // Advances to the next value. Returns false if there are no more values. // Must be called before the first value. Next() bool // Returns the current value. Should panic when the iterator is in an // invalid state. Value() interface{} // Ceases iteration prematurely. This should occur implicitly if Next // returns false. Stop() }
func GroupBy ¶
Group by returns an iterator of iterators over the values of the input iterator that consecutively return the same value when input to the key function. Note that repeated calls to each value of the GroupBy Iterator does not return a new iterator over the values for that key.
func StringIterator ¶
Click to show internal directories.
Click to hide internal directories.