Class/Object

cats.state

StateT

Related Docs: object StateT | package state

Permalink

final class StateT[F[_], S, A] extends Serializable

StateT[F, S, A] is similar to Kleisli[F, S, A] in that it takes an S argument and produces an A value wrapped in F. However, it also produces an S value representing the updated state (which is wrapped in the F context along with the A value.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StateT
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StateT(runF: F[(S) ⇒ F[(S, A)]])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def flatMap[B](fas: (A) ⇒ StateT[F, S, B])(implicit F: Monad[F]): StateT[F, S, B]

    Permalink
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. def inspect[B](f: (S) ⇒ B)(implicit F: Monad[F]): StateT[F, S, B]

    Permalink

    Inspect a value from the input state, without modifying the state.

  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def map[B](f: (A) ⇒ B)(implicit F: Monad[F]): StateT[F, S, B]

    Permalink
  15. def modify(f: (S) ⇒ S)(implicit F: Monad[F]): StateT[F, S, A]

    Permalink

    Modify the state (S) component.

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def run(initial: S)(implicit F: FlatMap[F]): F[(S, A)]

    Permalink

    Run with the provided initial state value

  20. def runA(s: S)(implicit F: FlatMap[F]): F[A]

    Permalink

    Run with the provided initial state value and return the final value (discarding the final state).

  21. def runEmpty(implicit S: Monoid[S], F: FlatMap[F]): F[(S, A)]

    Permalink

    Run with S's empty monoid value as the initial state.

  22. def runEmptyA(implicit S: Monoid[S], F: FlatMap[F]): F[A]

    Permalink

    Run with S's empty monoid value as the initial state and return the final state (discarding the final value).

  23. def runEmptyS(implicit S: Monoid[S], F: FlatMap[F]): F[S]

    Permalink

    Run with S's empty monoid value as the initial state and return the final state (discarding the final value).

  24. val runF: F[(S) ⇒ F[(S, A)]]

    Permalink
  25. def runS(s: S)(implicit F: FlatMap[F]): F[S]

    Permalink

    Run with the provided initial state value and return the final state (discarding the final value).

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def transform[B](f: (S, A) ⇒ (S, B))(implicit F: Monad[F]): StateT[F, S, B]

    Permalink

    Like map, but also allows the state (S) value to be modified.

  29. def transformF[G[_], B](f: (F[(S, A)]) ⇒ G[(S, B)])(implicit F: FlatMap[F], G: Applicative[G]): StateT[G, S, B]

    Permalink

    Like transform, but allows the context to change from F to G.

  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped