ChatGPT - State Monad Explanation