StreamT

abstract
class StreamT[M[_], A]

StreamT monad transformer.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def #::(elem: => A)(implicit M: Applicative[M]): StreamT[M, A]
Implicitly added by toDeferrer
def step: M[Step[M, A]]

Concrete methods

def ++(bs: => StreamT[M, A])(implicit m: Functor[M]): StreamT[M, A]
def ::(a: A)(implicit M: Applicative[M]): StreamT[M, A]
def asLazyList(implicit ev: M[Step[M, A]] === Id[Step[Id, A]]): LazyList[A]

Converts this StreamT to a lazy LazyList, i.e. without forcing evaluation of all elements. Note, however, that at least one element of this stream will be evaluated, and depending on the structure of this stream, up to two elements might be evaluated.

Converts this StreamT to a lazy LazyList, i.e. without forcing evaluation of all elements. Note, however, that at least one element of this stream will be evaluated, and depending on the structure of this stream, up to two elements might be evaluated.

def collect[B](pf: PartialFunction[A, B])(implicit M: Functor[M]): StreamT[M, B]
def distinctUntilChanged(latest: A)(implicit M: Functor[M], A: Equal[A]): StreamT[M, A]

Returns a new StreamT only containing items that are different from their previous items.

Returns a new StreamT only containing items that are different from their previous items.

Value Params
`latest`

the assuming previous item of the head element of this StreamT

def distinctUntilChanged(implicit M: Functor[M], A: Equal[A]): StreamT[M, A]

Returns a new StreamT only containing items that are different from their previous items.

Returns a new StreamT only containing items that are different from their previous items.

def drop(n: Int)(implicit M: Functor[M]): StreamT[M, A]
def dropWhile(p: A => Boolean)(implicit m: Functor[M]): StreamT[M, A]
def filter(p: A => Boolean)(implicit m: Functor[M]): StreamT[M, A]
def flatMap[B](f: A => StreamT[M, B])(implicit m: Functor[M]): StreamT[M, B]
def flatMapLatest[B](f: A => StreamT[M, B])(implicit M: Nondeterminism[M]): StreamT[M, B]

The flatMapLatest operator behaves much like the mergeMap except that whenever a new item is emitted by the source StreamT, it will not subscribe to and stop mirroring the StreamT that was generated from the previously-emitted item, and begin only mirroring the current one.

The flatMapLatest operator behaves much like the mergeMap except that whenever a new item is emitted by the source StreamT, it will not subscribe to and stop mirroring the StreamT that was generated from the previously-emitted item, and begin only mirroring the current one.

def foldLeft[B](z: B)(f: (B, A) => B)(implicit M: Monad[M]): M[B]
def foldLeftRec[B](z: B)(f: (B, A) => B)(implicit M: BindRec[M]): M[B]
def foldMap[B](f: A => B)(implicit M: Foldable[M], B: Monoid[B]): B
def foldRight[B](z: => B)(f: (=> A, => B) => B)(implicit M: Monad[M]): M[B]
def foldRightM[B](z: => M[B])(f: (=> A, => M[B]) => M[B])(implicit M: Monad[M]): M[B]

foldRight with potential to terminate early, e.g. on an infinite stream.

foldRight with potential to terminate early, e.g. on an infinite stream.

def foldRightRec[B](z: => B)(f: (=> A, => B) => B)(implicit M: BindRec[M]): M[B]
def foreach(f: A => M[Unit])(implicit M: Monad[M]): M[Unit]
def foreachRec(f: A => M[Unit])(implicit M: Monad[M], B: BindRec[M]): M[Unit]
def head(implicit M: Monad[M]): M[A]
def headOption(implicit M: Monad[M]): M[Option[A]]
def headOptionRec(implicit M: BindRec[M]): M[Option[A]]
def headRec(implicit M: BindRec[M]): M[A]
def isEmpty(implicit M: Monad[M]): M[Boolean]
def isEmptyRec(implicit M: BindRec[M]): M[Boolean]
def length(implicit m: Monad[M]): M[Int]
def lengthRec(implicit M: BindRec[M]): M[Int]
def map[B](f: A => B)(implicit m: Functor[M]): StreamT[M, B]
def mapM[B](f: A => M[B])(implicit M: Monad[M]): StreamT[M, B]
Since

7.0.1

def memoize(implicit m: Functor[M]): StreamT[M, A]
def mergeMap[B](f: A => StreamT[M, B])(implicit M: Nondeterminism[M]): StreamT[M, B]
def mergeWith(f2: => StreamT[M, A])(implicit M: Nondeterminism[M]): StreamT[M, A]
def scan[B >: A](op: (B, B) => B)(implicit M: Functor[M]): StreamT[M, B]

Computes a prefix scan of the elements of the collection.

Computes a prefix scan of the elements of the collection.

Note: The neutral element B may be applied more than once.

Type Params
B

element type of the resulting collection

Value Params
op

the associative operator for the scan

Returns

a new StreamT containing the prefix scan of the elements in this $coll

def scanLeft[B](head: B)(op: (B, A) => B)(implicit M: Applicative[M]): StreamT[M, B]

Produces a StreamT containing cumulative results of applying the operator going left to right, including the initial value.

Produces a StreamT containing cumulative results of applying the operator going left to right, including the initial value.

Type Params
B

the type of the elements in the resulting collection

Value Params
head

the initial value

op

the binary operator applied to the intermediate result and the element

Returns

collection with intermediate results

def tailM(implicit M: Monad[M]): M[StreamT[M, A]]
def tailMRec(implicit M: BindRec[M]): M[StreamT[M, A]]
def tailOption(implicit M: Monad[M]): M[Option[StreamT[M, A]]]
def tailOptionRec(implicit M: BindRec[M]): M[Option[StreamT[M, A]]]
def take(n: Int)(implicit M: Functor[M]): StreamT[M, A]
def takeWhile(p: A => Boolean)(implicit m: Functor[M]): StreamT[M, A]
def toLazyList(implicit M: Monad[M]): M[LazyList[A]]

Warning: Requires evaluation of the whole stream. Depending on the monad M, the evaluation will happen either immediately, or will be deferred until the resulting LazyList is extracted from the returned M.

Warning: Requires evaluation of the whole stream. Depending on the monad M, the evaluation will happen either immediately, or will be deferred until the resulting LazyList is extracted from the returned M.

def toLazyListRec(implicit M: BindRec[M]): M[LazyList[A]]

Warning: Requires evaluation of the whole stream. Depending on the monad M, the evaluation will happen either immediately, or will be deferred until the resulting LazyList is extracted from the returned M.

Warning: Requires evaluation of the whole stream. Depending on the monad M, the evaluation will happen either immediately, or will be deferred until the resulting LazyList is extracted from the returned M.

def trans[N[_]](t: NaturalTransformation[M, N])(implicit M: Functor[M]): StreamT[N, A]
def uncons(implicit M: Monad[M]): M[Option[(A, StreamT[M, A])]]
def unconsRec(implicit M: BindRec[M]): M[Option[(A, StreamT[M, A])]]
def weakMemoize(implicit m: Functor[M]): StreamT[M, A]