
6 Oct
2009
6 Oct
'09
12:08 a.m.
On Mon, Oct 5, 2009 at 10:54 PM, Floptical Logic
If I were to make an instance of MonadIO be a parameter to StateT and I wanted to use the Net monad (from Roll your own IRC bot on the wiki) with it, I would need to make Net an instance of MonadIO. What would this instance look like?
If you define 'Net' as in the tutorial above, it will already be an instance of MonadIO :-)
I think the loop function is the least of my worries. I am more concerned about the runCmd function. What would go in place of print in runCmd?
The function 'liftIO . print' will work in any monad which is an instance of MonadIO. Take a look at http://hackage.haskell.org/packages/archive/mtl/1.1.0.2/doc/html/Control-Mon... for where 'liftIO' comes from. Antoine