<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I'm playing around with a little program that implements a simple virtual machine.&nbsp; I want to use a monad to represent machine state.&nbsp; I created a data type for the machine (VM) and a monadic type for the monadic computations using it.&nbsp; I declared this an instance of MonadState and Monad and created the usual operators.&nbsp; That stuff works.&nbsp; My issue is that I want to run some functions in the machine monad, call it VMS - "virtual machine w/state" and then pull the underlying VM data structure out and print it.<br><br>I've read about monad transformers, lift, liftM, liftIO and all these instances in the libraries like MonadIO and am rather confused.&nbsp; The most sensible conclusion I can reach is that I probably need to create my own Transformer monad and define liftIO.&nbsp; Is this where I need to go?&nbsp; Also, my VMS monad doesn't
 really do anything different from the State monad except explicitly specify that state is a VM and not a generic type.&nbsp; Am I doing too much work creating my own instances here?&nbsp; Would a simple "type" statement work?<br></td></tr></table><br>