Monads and interactive programs