Refactor the previously stateful event loop implementation into message reduction and side effect execution.
We implement a DSL that is emitted by the message reduction.
The implementation aims to imitate an event sourcing architecture inspired by elm.
This makes testing easier, because the complex reaction of messages is now split into digestible commands.
Furthermore, the commands are composable.
The fine grained use of TVar's has been abandoned in favour of a single global TVar.
All mutation to that single global has to be performed in the function runEventLoop.
No other function is allowed to mutate this variable, but only to read
Refactor the previously stateful event loop implementation into message reduction and side effect execution. We implement a DSL that is emitted by the message reduction. The implementation aims to imitate an event sourcing architecture inspired by elm. This makes testing easier, because the complex reaction of messages is now split into digestible commands. Furthermore, the commands are composable. The fine grained use of
TVar
's has been abandoned in favour of a single globalTVar
. All mutation to that single global has to be performed in the functionrunEventLoop
. No other function is allowed to mutate this variable, but only to read