LazySequenceType
protocol LazySequenceType : SequenceType
Returns a lazy sequence of self, chunked into arrays of adjacent equal values “`swift [1, 2, 2, 3, 1, 1, 3, 4, 2].lazy.group()
[1], [2, 2], [3], [1, 1], [3], [4], [2] ”`
-
Returns a lazy sequence of self, chunked into arrays of adjacent equal values - Parameter isEquivalent: a function that returns true if its two parameters are equal “`swift [1, 3, 5, 20, 22, 18, 6, 7].lazy.groupBy { (a,b) in abs(a - b) < 5 }
[1, 3, 5], [20, 22, 18], [6, 7] ”`
Declaration
Swift
func group(isEquivalent: (Generator.Element, Generator.Element) -> Bool) -> GroupBySeq<Self>
Parameters
isEquivalent
a function that returns true if its two parameters are equal