public static TState Execute <TState, TValue>(this IStateMonad <TState, TValue> self, TState state, Action <TValue> onValue) { StateResult <TState, TValue> result = self.Run(state); onValue(result.Value); return(result.State); }
public StateResult <TState, TValue> Run(TState state) { StateResult <TState, TValue> result = _self.Run(state); _action(result); return(result); }
public StateResult <TState, TValue> RunState(TState state) { StateResult <TState, TValue> result = _self.RunState(state); if (_selector(result)) { return(result); } else { return(_elseSource.RunState(state)); } }
public StateResult <TState, TResult> Run(TState state) { StateResult <TState, TValue> result = _self.Run(state); return(StateResult.Create(result.State, _selector(result.Value))); }
public StateResult <TState, RWSResult <TOutput, TState, TValue> > RunState(TState state) { return(StateResult.Create(state, _self.RunRWS(_environment, state))); }
public StateResult <TState, TState> Run(TState state) { return(StateResult.Create(_state, _state)); }
public StateResult <TState, Unit> RunState(TState state) { return(StateResult.Create(_state, Unit.Default)); }
public StateResult <TState, TState> RunState(TState state) { return(StateResult.Create(state, _selector(state))); }
public StateResult <TState, TValue> RunState(TState state) { StateResult <TState, TValue> result = _self.RunState(state); return(StateResult.Create(_selector(result.State), result.Value)); }