3 ms·
Monads are not strictly necessary in any language, and don't have to cover I/O at all. They are instead the same interface to a useful abstraction. They may as
by loopz 5y ago
Monads are not strictly necessary in any language, and don't have to cover I/O at all. They are instead the same interface to a useful abstraction. They may as such be used together with all helper-functions and types, for many situations where one needs to wrap and unwrap data/types into more complex representations, and back again. They remain pure, since the actual side effects happen lazily outside of expression evaluations (by magic!).
They can also assist in decoupling code from side-effects, while keeping code simpler and coherent. Like with Go, just more subtly, it seems Haskell directs the programmer towards better code design, by giving helpful errors from the type system. This is because the types ensures that you avoid mixing what should not be mixed. If there's alot of errors and progress is slow, this is to be expected at startup, as you will be directed to find the better code structure to build your shell on. Once the shell is more complete, it will be easier to incorporate the functional core in that, or vica versa. So in that area also, it is helpful and useful, once one groks the hints of linter and compiler errors (use an IDE for this).