
5 Oct
2009
5 Oct
'09
11:54 p.m.
Instead of specifying the monad implementation, specify the interface. That is, you are using state operations (from MonadState) and IO operations (from MonadIO). Try removing all the type signatures that mention PDState and see what you get.
E.g., loop :: (MonadState PD m, MonadIO m) => m a
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? 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? Thanks