Stream.Preview

object Preview
Source
__.scala
class java.lang.Object
trait scala.Matchable
class Any

Member

abstract class LazySize

When evaluated with comparison operators, [LazySize] preloads just enough stream elements to answer the questions

def s  : Stream[String]         = ???
def ps : Stream.Preview[String] = s.preview

ps.previewSize >= 10 // This will pre-load no more than 10 elements

ps.previewSize < 100 // This will pre-load no more than 100 elements
Source
LazySize.scala