Combining multiple states in StateT
I am writing a program that runs as a daemon. To create the daemon, the user supplies a set of implementations for each of the required classes (one of them is a database) All of these classes have functions have type signatures of the form StateT s IO a , but s is different for each class. Suppose each of the classes follows this pattern: import Control.Monad (liftM) import Control.Monad.State (StateT(..), get) class Hammer h where driveNail :: StateT h IO () data ClawHammer = MkClawHammer Int -- the real implementation is more complex instance Hammer ClawHammer where driveNail = return () --