Package fj.data
Class State<S,A>
java.lang.Object
fj.data.State<S,A>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBind the given function across this state.static <S,
A> State <S, A> constant
(A a) private static <S> P2
<S, S> dup
(S s) static <S,
A, B> State <S, B> Bind the given function across this state.gets()
static <S,
A> State <S, A> static <S> State
<S, S> init()
put
(S s) Evaluate each action in the sequence from left to right, and collect the results.private static <S,
A> State <S, A> suspended
(F<S, Trampoline<P2<S, A>>> runF) Map each element of a structure to an action, evaluate these actions from left to right and collect the results.static <S,
A> State <S, A> static <S> State
<S, S>
-
Field Details
-
runF
-
-
Constructor Details
-
State
-
-
Method Details
-
unit
-
init
-
units
-
dup
-
constant
-
gets
-
put
-
modify
-
flatMap
-
sequence
Evaluate each action in the sequence from left to right, and collect the results. -
traverse
Map each element of a structure to an action, evaluate these actions from left to right and collect the results. -
suspended
-
run
-
eval
-
exec
-
gets
-
map
-
mapState
-
withs
-
bind
Bind the given function across this state.- Type Parameters:
B
- the type of the output value- Parameters:
f
- the given function- Returns:
- the state
-
flatMap
Bind the given function across this state.- Type Parameters:
B
- the type of the output value- Parameters:
f
- the given function- Returns:
- the state
-