(Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.
(spanningIterator: MonadOps[(K, Seq[T])]).filter(p)
(spanningIterator: MonadOps[(K, Seq[T])]).flatMap(f)
(spanningIterator: MonadOps[(K, Seq[T])]).map(f)
(spanningIterator: MonadOps[(K, Seq[T])]).withFilter(p)
An iterator that groups items having the same value of the given function (key). To be included in the same group, items with the same key must be next to each other in the original collection.
SpanningIteratorbuffers internally one group at a time and the wrapped iterator is consumed in a lazy way.Example: