reduce

abstract fun reduce(state: S, action: A): S

Returns the next state for action without mutating state.