4 ms·
Agreed. 5 years ago I thought that Haskell's IO monad was genius. I hope it trickles into a mainstream language before I retire. Sure, it's an extra arg to eve
by ReactiveJelly 3y ago
Agreed. 5 years ago I thought that Haskell's IO monad was genius.
I hope it trickles into a mainstream language before I retire. Sure, it's an extra arg to every non-pure function.
So what? Write more pure functions! If a function shouldn't use the network, pass it an IO that can't do so. If it shouldn't touch disk, pass it an IO that can't do so.
This may complicated printf logging... Or maybe there is an IO that only allows passing messages to a logging module, and the logging module can write to disk. So the logging module gets more auditing attention than pure functions.
- empath-nirvana 3y agoI think where this is headed is algebraic effects, not using an io monad.