MCPcopy Create free account
hub / github.com/Soft/iter / Slice

Function Slice

iterator.go:65–69  ·  view source on GitHub ↗

Slice returns an Iterator that yields elements from a slice.

(slice []T)

Source from the content-addressed store, hash-verified

63
64// Slice returns an Iterator that yields elements from a slice.
65func Slice[T any](slice []T) Iterator[T] {
66 return &sliceIter[T]{
67 slice: slice,
68 }
69}
70
71func (it *sliceIter[T]) Next() Option[T] {
72 if len(it.slice) == 0 {

Callers 14

TestSliceFunction · 0.85
TestDropFunction · 0.85
TestDropWhileFunction · 0.85
TestTakeWhileFunction · 0.85
TestFoldFunction · 0.85
TestChainFunction · 0.85
TestFindFunction · 0.85
TestFlattenFunction · 0.85
TestAllFunction · 0.85
TestAnyFunction · 0.85
TestNthFunction · 0.85
TestEqualFunction · 0.85

Calls

no outgoing calls

Tested by 14

TestSliceFunction · 0.68
TestDropFunction · 0.68
TestDropWhileFunction · 0.68
TestTakeWhileFunction · 0.68
TestFoldFunction · 0.68
TestChainFunction · 0.68
TestFindFunction · 0.68
TestFlattenFunction · 0.68
TestAllFunction · 0.68
TestAnyFunction · 0.68
TestNthFunction · 0.68
TestEqualFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…