Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A 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.



We 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.


That'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"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: