/fullypeekable

Peek forward in a Scala iterator as far as you'd like, memory allowing!

Primary LanguageScalaMIT LicenseMIT

fullypeekable

Unit Tests Coverage Status Language

Peek forward in an iterator as far as you'd like, memory allowing!

Laugavegur Trail, Iceland

val peekable = Seq(1, 2, 3).iterator.fullyPeekable
peekable.liftMany(0, 3) // Seq(Some(1), Some(2), Some(3), None)
peekable.toSeq          // Seq(1, 2, 3)

If Mill is your build tool

ivyDeps ++ Agg(ivy"io.cvbio.collection::fullypeekable::1.0.0")

If SBT is your build tool

libraryDependencies += "io.cvbio.collection" %% "fullypeekable" % "1.0.0"