IO
- Companion
- class
trait Sum
trait Mirror
trait IOLowPriorityImplicits
class IOCompanionPlatform
class Object
trait Matchable
class Any
Type members
Inherited classlikes
Value members
Methods
This is a low-level API which is meant for implementors,
please use
depending on the use case
please use
background
, start
, async
, or Deferred
instead,depending on the use case
def parTraverseN[T <: ([_$21] =>> Any), A, B](n: Int)(ta: T[A])(f: A => IO[B])(evidence$3: Traverse[T]): IO[T[B]]
Like
Parallel.parTraverse
, but limits the degree of parallelism. def parSequenceN[T <: ([_$22] =>> Any), A](n: Int)(tma: T[IO[A]])(evidence$4: Traverse[T]): IO[T[A]]
Like
Parallel.parSequence
, but limits the degree of parallelism. def racePair[A, B](left: IO[A], right: IO[B]): IO[Either[(OutcomeIO[A], FiberIO[B]), (FiberIO[A], OutcomeIO[B])]]
def bracketFull[A, B](acquire: Poll[[A] =>> IO[A]] => IO[A])(use: A => IO[B])(release: (A, OutcomeIO[B]) => IO[Unit]): IO[B]
Returns the given argument if
cond
is true, otherwise IO.Unit
- See also
- IO.unlessA for the inverseIO.raiseWhen for conditionally raising an error
Returns the given argument if
cond
is false, otherwise IO.Unit
- See also
- IO.whenA for the inverseIO.raiseWhen for conditionally raising an error
Returns
raiseError
when the cond
is true, otherwise IO.unit
- Example
- {{{
val tooMany = 5
val x: Int = ???
IO.raiseWhen(x >= tooMany)(new IllegalArgumentException("Too many"))
}}}
Returns
raiseError
when cond
is false, otherwise IO.unit- Example
- {{{
val tooMany = 5
val x: Int = ???
IO.raiseUnless(x < tooMany)(new IllegalArgumentException("Too many"))
}}}
Reads a line as a string from the standard input using the platform's
default charset, as per
default charset, as per
java.nio.charset.Charset.defaultCharset()
.The effect can raise a
before the EOF is observed. This should never happen with the standard
input, unless it has been replaced with a finite
through
java.io.EOFException
if no input has been consumedbefore the EOF is observed. This should never happen with the standard
input, unless it has been replaced with a finite
java.io.InputStream
through
java.lang.System#setIn
or similar.- Returns
-
an IO effect that describes reading the user's input from the
standard input as a string - See also
cats.effect.std.Console#readLineWithCharset
for reading using a
customjava.nio.charset.Charset
Prints a value to the standard output using the implicit
instance.
cats.Show
instance.
- Value Params
- a
-
value to be printed to the standard output
- See also
cats.effect.std.Console
for more standard input, output and error
operations