final class CompileOps[F[_], G[_], O] extends AnyRef
Projection of a Stream
providing various ways to compile a Stream[F,O]
to an F[...]
.
- Source
- Stream.scala
- Alphabetic
- By Inheritance
- CompileOps
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to any2stringadd[CompileOps[F, G, O]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (CompileOps[F, G, O], B)
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to ArrowAssoc[CompileOps[F, G, O]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
drain: G[Unit]
Compiles this stream in to a value of the target effect type
F
and discards any output values of the stream. -
def
ensuring(cond: (CompileOps[F, G, O]) ⇒ Boolean, msg: ⇒ Any): CompileOps[F, G, O]
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to Ensuring[CompileOps[F, G, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (CompileOps[F, G, O]) ⇒ Boolean): CompileOps[F, G, O]
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to Ensuring[CompileOps[F, G, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): CompileOps[F, G, O]
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to Ensuring[CompileOps[F, G, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): CompileOps[F, G, O]
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to Ensuring[CompileOps[F, G, O]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fold[B](init: B)(f: (B, O) ⇒ B): G[B]
Compiles this stream in to a value of the target effect type
F
by folding the output values together, starting with the providedinit
and combining the current value with each output value. -
def
foldChunks[B](init: B)(f: (B, Chunk[O]) ⇒ B): G[B]
Compiles this stream in to a value of the target effect type
F
by folding the output chunks together, starting with the providedinit
and combining the current value with each output chunk.Compiles this stream in to a value of the target effect type
F
by folding the output chunks together, starting with the providedinit
and combining the current value with each output chunk.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
-
def
foldMonoid(implicit O: Monoid[O]): G[O]
Like fold but uses the implicitly available
Monoid[O]
to combine elements.Like fold but uses the implicitly available
Monoid[O]
to combine elements.scala> import cats.implicits._, cats.effect.IO scala> Stream(1, 2, 3, 4, 5).covary[IO].compile.foldMonoid.unsafeRunSync res0: Int = 15
Example: -
def
foldSemigroup(implicit O: Semigroup[O]): G[Option[O]]
Like fold but uses the implicitly available
Semigroup[O]
to combine elements.Like fold but uses the implicitly available
Semigroup[O]
to combine elements. If the stream emits no elements,None
is returned.scala> import cats.implicits._, cats.effect.IO scala> Stream(1, 2, 3, 4, 5).covary[IO].compile.foldSemigroup.unsafeRunSync res0: Option[Int] = Some(15) scala> Stream.empty.covaryAll[IO, Int].compile.foldSemigroup.unsafeRunSync res1: Option[Int] = None
Example: -
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to StringFormat[CompileOps[F, G, O]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last: G[Option[O]]
Compiles this stream in to a value of the target effect type
F
, returningNone
if the stream emitted no values and returning the last value emitted wrapped inSome
if values were emitted.Compiles this stream in to a value of the target effect type
F
, returningNone
if the stream emitted no values and returning the last value emitted wrapped inSome
if values were emitted.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.last.unsafeRunSync res0: Option[Int] = Some(4)
Example: -
def
lastOrError(implicit G: MonadError[G, Throwable]): G[O]
Compiles this stream in to a value of the target effect type
F
, raising aNoSuchElementException
if the stream emitted no values and returning the last value emitted otherwise.Compiles this stream in to a value of the target effect type
F
, raising aNoSuchElementException
if the stream emitted no values and returning the last value emitted otherwise.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.lastOrError.unsafeRunSync res0: Int = 4 scala> Stream.empty.covaryAll[IO, Int].compile.lastOrError.attempt.unsafeRunSync res1: Either[Throwable, Int] = Left(java.util.NoSuchElementException)
Example: -
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
to[C[_]](implicit cbf: CanBuildFrom[Nothing, O, C[O]]): G[C[O]]
Compiles this stream into a value of the target effect type
F
by logging the output values to aC
, given aCanBuildFrom
.Compiles this stream into a value of the target effect type
F
by logging the output values to aC
, given aCanBuildFrom
.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.to[List].unsafeRunSync res0: List[Int] = List(0, 1, 2, 3, 4)
Example: -
def
toChunk: G[Chunk[O]]
Compiles this stream in to a value of the target effect type
F
by logging the output values to aChunk
.Compiles this stream in to a value of the target effect type
F
by logging the output values to aChunk
.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.toChunk.unsafeRunSync res0: Chunk[Int] = Chunk(0, 1, 2, 3, 4)
Example: -
def
toList: G[List[O]]
Compiles this stream in to a value of the target effect type
F
by logging the output values to aList
.Compiles this stream in to a value of the target effect type
F
by logging the output values to aList
. Equivalent toto[List]
.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.toList.unsafeRunSync res0: List[Int] = List(0, 1, 2, 3, 4)
Example: -
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
toVector: G[Vector[O]]
Compiles this stream in to a value of the target effect type
F
by logging the output values to aVector
.Compiles this stream in to a value of the target effect type
F
by logging the output values to aVector
. Equivalent toto[Vector]
.When this method has returned, the stream has not begun execution -- this method simply compiles the stream down to the target effect type.
scala> import cats.effect.IO scala> Stream.range(0,100).take(5).covary[IO].compile.toVector.unsafeRunSync res0: Vector[Int] = Vector(0, 1, 2, 3, 4)
Example: -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (CompileOps[F, G, O], B)
- Implicit
- This member is added by an implicit conversion from CompileOps[F, G, O] to ArrowAssoc[CompileOps[F, G, O]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc