>> What kind of code would you write if it would be such monad?
>
> Useless stuff like:
>
> s2 = do
> push 11
> push 17
> count >>= push
> binop (+)
> binop (*)
> pop
Then you should use something like
data Stack a = Stack {run :: [Integer] -> (a,[Integer])}