More.ScalaCollections

Scala Collections Extension

These are extension methods universally available for all Scala Collections, which extend scala.collections.IterableOnce.

Scala Seq, List, Vector, and the likes are covered.

Also note that all Scala collections are implicitly convertibe to Stream, thus they can be used directly everywhere where Stream is required:

 val buf: Buffer[String] = NEW

 buf ++= Stream("A","B") ++= List("C","D") ++= Vector("E","F") ++= Seq("X","Y","Z")

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

Def

inline def ~~[A]: Stream[A]

Alias to .stream

Alias to .stream

Note. In cases when target collection already has a "stream" method with different semantics, calling ~~ is the only option.

Source
__.scala
inline def pack[A](using s: Specialized[A]): s.Pack

Pack of elements

Pack of elements

Returns Pack of collection elements

Source
__.scala
inline def stream[A]: Stream[A]

Stream of elements

Stream of elements

Returns Stream of collection elements

Source
__.scala