Skip to content
Commit c8c8c6d5 authored by Douglas Raillard's avatar Douglas Raillard
Browse files

lisa.monad: Replace the State monad implementation

BREAKING CHANGE
FEATURE

Replace the original custom-made State monad implementation with a full
featured monad transformer implementation.

This will allow combining multiple independent state monads, as well as
interop with event loops (e.g. asyncio), and allow new effects to be
added along the way such as the short-circuiting Option.

Breaking changes:

* Remove the automatic awaiting of monadic arguments to user-defined
  coroutine functions. The reason is that it was a misfeature that
  worked for the lisa.fuzz.Gen monad, but is actually quite problematic
  for other state monads as the user looses control over the ordering of
  side effects. This can unfortunately be extremely important for some
  monads.

* Re-purpose the "lift" method to act like a monad transformer lift.
  Existing use of "Monad.lift()" need to be converted to "Monad.do()"
  instead.

* Rename StateMonad into State

* StateMonad values can now only be called once.
parent 3eb4d46b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment