State<S,A> |
State.censor(Fn1<? super S,? extends S> fn) |
Update the accumulated state.
|
<B> State<S,B> |
State.discardL(Applicative<B,State<S,?>> appB) |
Sequence both this Applicative and appB , discarding this Applicative's
result and returning appB .
|
<B> State<S,A> |
State.discardR(Applicative<B,State<S,?>> appB) |
Sequence both this Applicative and appB , discarding appB's result and
returning this Applicative .
|
<B> State<S,B> |
State.flatMap(Fn1<? super A,? extends Monad<B,State<S,?>>> f) |
Chain dependent computations that may continue or short-circuit based on previous results.
|
<B> State<S,B> |
State.fmap(Fn1<? super A,? extends B> fn) |
Covariantly transmute this functor's parameter using the given mapping function.
|
static <A> State<A,A> |
State.get() |
Create a State that simply returns back the initial state as both the result and the final state
|
static <S,A> State<S,A> |
State.gets(Fn1<? super S,? extends A> fn) |
Create a State that maps its initial state into its result, but leaves the initial state unchanged.
|
<B> State<S,Tuple2<A,B>> |
State.listens(Fn1<? super S,? extends B> fn) |
Map the accumulation into a value and pair it with the current output.
|
State<S,A> |
State.local(Fn1<? super S,? extends S> fn) |
Modify this MonadReader's environment after reading it but before running the effect.
|
<B> State<S,B> |
State.mapState(Fn1<? super Tuple2<A,S>,? extends Tuple2<B,S>> fn) |
Map both the result and the final state to a new result and final state.
|
static <S> State<S,Unit> |
State.modify(Fn1<? super S,? extends S> fn) |
Create a State that maps its initial state into its final state, returning a Unit result type.
|
<B> State<S,B> |
State.pure(B b) |
Lift the value b into this applicative functor.
|
static <S> State<S,Unit> |
State.put(S s) |
Create a State that ignores its initial state, returning a Unit result and s as its
final state.
|
static <S,A> State<S,A> |
State.state(A a) |
Create a State that returns a as its result and its initial state as its final state.
|
static <S,A> State<S,A> |
State.state(Fn1<? super S,? extends Tuple2<A,S>> stateFn) |
Create a State from stateFn , a function that maps an initial state into a result and a final
state.
|
<B> State<S,B> |
State.trampolineM(Fn1<? super A,? extends MonadRec<RecursiveResult<A,B>,State<S,?>>> fn) |
|
State<S,A> |
State.withState(Fn1<? super S,? extends S> fn) |
Map the final state to a new final state using the provided function.
|
<B> State<S,B> |
State.zip(Applicative<Fn1<? super A,? extends B>,State<S,?>> appFn) |
Given another instance of this applicative over a mapping function, "zip" the two instances together using
whatever application semantics the current applicative supports.
|