Let me try to answer Herth's question in the comments, because that is a rather different question.
The question is, why can't we just write
class State s where
get :: s
put :: s -> ()
Well, we could write this. But now the question is, what can we do about it? And the hard part is, if we have c code put x, and then gethow do we bind getto putso that the return value is returned the way it was inserted?
, () s . -, . put get ( , - , - ).
, , >> :
(>>) :: m a -> m b -> m b
(put x) >> get
EDIT: , StateT,
foo :: StateT Int IO ()
foo = do
put 3
x <- get
lift $ print x
main = evalStateT foo 0