ST

sealed abstract
class ST[S, A]

Purely functional mutable state threads. Based on JL and SPJ's paper "Lazy Functional State Threads"

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def bracket[B, C](after: A => IO[B])(during: A => IO[C]): IO[C]
Implicitly added by STToIO

Applies the "during" action, calling "after" regardless of whether there was an exception. All exceptions are rethrown. Generalizes try/finally.

Applies the "during" action, calling "after" regardless of whether there was an exception. All exceptions are rethrown. Generalizes try/finally.

def bracketIO[M[_], B](after: A => IO[Unit])(during: A => M[B])(implicit m: MonadControlIO[M]): M[B]
Implicitly added by STToIO
def bracketOnError[B, C](after: A => IO[B])(during: A => IO[C]): IO[C]
Implicitly added by STToIO

A variant of "bracket" that performs the final action only if there was an error.

A variant of "bracket" that performs the final action only if there was an error.

def bracket_[B, C](after: IO[B])(during: IO[C]): IO[C]
Implicitly added by STToIO

A variant of "bracket" where the return value of this computation is not needed.

A variant of "bracket" where the return value of this computation is not needed.

def catchLeft: IO[Throwable \/ A]
Implicitly added by STToIO

Returns a disjunction result which is right if no exception was raised, or left if an exception was raised.

Returns a disjunction result which is right if no exception was raised, or left if an exception was raised.

def catchSome[B](p: Throwable => Option[B], handler: B => IO[A]): IO[A]
Implicitly added by STToIO

Executes the handler for exceptions that are raised and match the given predicate. Other exceptions are rethrown.

Executes the handler for exceptions that are raised and match the given predicate. Other exceptions are rethrown.

def catchSomeLeft[B](p: Throwable => Option[B]): IO[B \/ A]
Implicitly added by STToIO

Like "catchLeft" but takes a predicate to select which exceptions are caught.

Like "catchLeft" but takes a predicate to select which exceptions are caught.

def ensuring[B](sequel: IO[B]): IO[A]
Implicitly added by STToIO

Like "bracket", but takes only a computation to run afterward. Generalizes "finally".

Like "bracket", but takes only a computation to run afterward. Generalizes "finally".

def except(handler: Throwable => IO[A]): IO[A]
Implicitly added by STToIO

Executes the handler if an exception is raised.

Executes the handler if an exception is raised.

def flatMap[B](f: A => IO[B]): IO[B]
Implicitly added by STToIO

Continues this action with the given action.

Continues this action with the given action.

def flatMap[B](g: A => ST[S, B]): ST[S, B]
def liftIO[M[_]](implicit m: MonadIO[M]): M[A]
Implicitly added by STToIO

Lift this action to a given IO-like monad.

Lift this action to a given IO-like monad.

def map[B](f: A => B): IO[B]
Implicitly added by STToIO

Continues this action with the given function.

Continues this action with the given function.

def map[B](g: A => B): ST[S, B]
def onException[B](action: IO[B]): IO[A]
Implicitly added by STToIO

Like "finally", but only performs the final action if there was an exception.

Like "finally", but only performs the final action if there was an exception.

Implicitly added by STToIO

Constructs an IO action whose steps may be interleaved with another. An unsafe operation, since it exposes a trampoline that allows one to step through the components of the IO action.

Constructs an IO action whose steps may be interleaved with another. An unsafe operation, since it exposes a trampoline that allows one to step through the components of the IO action.

Implicitly added by STToIO

Runs I/O and performs side-effects. An unsafe operation. Do not call until the end of the universe.

Runs I/O and performs side-effects. An unsafe operation. Do not call until the end of the universe.

def unsafeZip[B](iob: IO[B]): IO[(A, B)]
Implicitly added by STToIO

Interleaves the steps of this IO action with the steps of another, yielding the results of both.

Interleaves the steps of this IO action with the steps of another, yielding the results of both.

def unsafeZipWith[B, C](iob: IO[B], f: (A, B) => C): IO[C]
Implicitly added by STToIO

Interleaves the steps of this IO action with the steps of another, consuming the results of both with the given function.

Interleaves the steps of this IO action with the steps of another, consuming the results of both with the given function.

def unsafeZip_[B](iob: IO[B]): IO[B]
Implicitly added by STToIO

Interleaves the steps of this IO action with the steps of another, ignoring the result of this action.

Interleaves the steps of this IO action with the steps of another, ignoring the result of this action.

def using[C](f: A => IO[C])(implicit resource: Resource[A]): IO[C]
Implicitly added by STToIO

An automatic resource management.

An automatic resource management.