cats.state

StateT

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
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

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

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

  12. final def getClass(): Class[_]

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

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

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

  15. final def isInstanceOf[T0]: Boolean

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

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

    Modify the state (S) component.

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

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

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

    Run with the provided initial state value

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

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

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

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

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  29. def toString(): String

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

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

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

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

  32. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped