3 ms·
That's not quite fair though, the problem as he states it is to do this after you've written the program. So while yes, you could use the State Monad that might
by almost 17y ago
That's not quite fair though, the problem as he states it is to do this after you've written the program. So while yes, you could use the State Monad that might not be a trivial change to the code. Things might be even worse if the function was already written in another Monad, Monad Transformers can be just a little tricky. Unless of course you write everything in the State Monad just in case you ever have to do anything like that :)