But there is something on the horizon for Scala:
https://github.com/lampepfl/dotty/blob/release-3.1.0/docs/do...
One can have a proper effect system on the JVM also already today with Flix:
https://en.wikipedia.org/wiki/Flix_(programming_language)#Po...
You could use other monads though.
> Haskell similarly suffers
Haskell practitioners aim to write as much code as possible outside the IO monad. If everything you write lives inside that monad, what's the benefit?
The nice thing about Haskell is that if you write every function with IO in its signature, it's bound to raise eyebrows in code reviews, whereas in most other mainstream languages everything lives in an IO monad by default!
IO on it’s own could mean disk, network, environment variables, sub processes, etc.
My take away is that they’d like to see IO defined as the union of its parts that can also be decomposed, so you’d have a DiskIO monad or ExecIO
That way you can be more certain that you’re not accidentally going to do a bunch of network io before your sub process kicks off. Right now you can’t have that guarantee (out of the box, at least. idk if there’re any user land libraries to do such a thing)
Haskell similarly suffers, I'd like to see IO broken down into composable units of functionality so I can see if e.g. my logging library has some ridiculous network constraint.