An anonymous implementation of the conversion from T to Monad in StateTOps, as having StateT extend Monad causes failure in the compiler typing
Moved the impl of map and flatmap from the StateT data structure to the typeclass impl - simplifies having to pass around the implicit def of the underlying monad, and keeps complex implementation all in one place
Moved impl of map2 and sequence to StateMonad, as it depended only on plain monad operations
Tidying up
Realised I could remove a type param from StateMonad and simplify things
Created WriterT and made it implement StateMonad so the stack has now become WriterT[StateT[Identity]]
Added WriterMonad api and updated simulation to use that to record inputs
Removed the old way of recording inputs via the state monad
Pulled out some type aliases to simplify describing the monad stack
Flipped the stack, so its StateT over WriterT, and so made StateT a WriterMonad
Woohoo. Working MonadTrans typeclass
Put both stack creations (StateT over WriterT and WriterT over StateT) into the main fn for easy reference