The bytecode compiler interpretation for the \gls{MTASK} language is implemented as a monad stack containing a writer monad and a state monad.
The writer monad is used to generate code snippets locally without having to store them in the monadic values.
The state monad accumulates the code, and stores the stateful data the compiler requires.
\Cref{lst:compiler_state} shows the data type for the state, storing:
function the compiler currently is in;
code of the main expression;
The bytecode compiler interpretation for the \gls{MTASK} language is implemented as a monad stack containing a writer monad and a state monad.
The writer monad is used to generate code snippets locally without having to store them in the monadic values.
The state monad accumulates the code, and stores the stateful data the compiler requires.
\Cref{lst:compiler_state} shows the data type for the state, storing:
function the compiler currently is in;
code of the main expression;