Uses of Class
com.jnape.palatable.lambda.functor.builtin.State
Packages that use State
-
Uses of State in com.jnape.palatable.lambda.functor.builtin
Methods in com.jnape.palatable.lambda.functor.builtin that return StateModifier and TypeMethodDescriptionUpdate the accumulated state.State.discardL
(Applicative<B, State<S, ?>> appB) Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
.State.discardR
(Applicative<B, State<S, ?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.Chain dependent computations that may continue or short-circuit based on previous results.Covariantly transmute this functor's parameter using the given mapping function.static <A> State
<A, A> State.get()
Create aState
that simply returns back the initial state as both the result and the final statestatic <S,
A> State <S, A> Create aState
that maps its initial state into its result, but leaves the initial state unchanged.Map the accumulation into a value and pair it with the current output.Modify thisMonadReader's
environment after reading it but before running the effect.Map both the result and the final state to a new result and final state.State.pure
(B b) Lift the valueb
into this applicative functor.State.put
(S s) static <S,
A> State <S, A> State.state
(A a) Create aState
that returnsa
as its result and its initial state as its final state.static <S,
A> State <S, A> Create aState
fromstateFn
, a function that maps an initial state into a result and a final state.State.trampolineM
(Fn1<? super A, ? extends MonadRec<RecursiveResult<A, B>, State<S, ?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
instruction.Map the final state to a new final state using the provided function.Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.Methods in com.jnape.palatable.lambda.functor.builtin that return types with arguments of type StateModifier and TypeMethodDescriptionGiven alazy
instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.State.pureState()
Method parameters in com.jnape.palatable.lambda.functor.builtin with type arguments of type StateModifier and TypeMethodDescriptionState.discardL
(Applicative<B, State<S, ?>> appB) Sequence both thisApplicative
andappB
, discarding thisApplicative's
result and returningappB
.State.discardR
(Applicative<B, State<S, ?>> appB) Sequence both thisApplicative
andappB
, discardingappB's
result and returning thisApplicative
.Chain dependent computations that may continue or short-circuit based on previous results.Given alazy
instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.State.trampolineM
(Fn1<? super A, ? extends MonadRec<RecursiveResult<A, B>, State<S, ?>>> fn) Given some operation yielding aRecursiveResult
inside thisMonadRec
, internally trampoline the operation until it yields atermination
instruction.Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.