def test_exec_state(self): value = 7 state = list() msg = "*2" m_one = return_(value) m_two = m_one >= (lambda a: State(lambda s: (a * 2, s.append(msg) or s))) self.assertEquals([msg], State.execState(m_two, state))
def exec_pipeline(state_monad, state): return State.execState(state_monad, state)
def exec_pipeline(state_monad, state): wrapped_state = State.execState(state_monad, state) return wrapped_state.state