4 ms·
Why would you want to use the I/O monad in Python?
by vmchale 6y ago
Why would you want to use the I/O monad in Python?
- posco 6y agoA big reason to use IO as a value (which IMO is a better name than IO monad), is the same in all languages: reasoning about immutable values is easier than side effects. If we can take complex IO operations and use composition tools exactly the same as other immutable values, it’s very nice. Of course, in my experience, this is so foreign to people who haven’t worked with it for a time it is very difficult to sell in small reply.
- BiteCode_dev 6y agoWe have coroutines for that: it delegates any blocking behavior to outside of your code. Introducing a new paradigm while this one just got in would be overkill IMO.
- pcstl 6y agoThat's why a lot of functional language research is moving towards effect handlers, which could be explained in a nutshell as "coroutines, but for anything"