Hacker News new | past | comments | ask | show | jobs | submit login

It's the same for many things. Java throws, const-correctness in C++, etc, etc.

As some other comment said, it's like the Haskell IO monad and that's OK, because it lets you isolate and be aware of the implications of that code.




Haskell has <$> and the infrastructure of HKTs to stop this infectious propagation of IO, other languages do not, and their async/await colors do not isolate side-effectful actions from the rest pure parts of your codebase.

https://hackage.haskell.org/package/base-4.20.0.1/docs/Prelu...


> other languages do not

Which ones? I think there's always some way to isolate, even if ugly.


> Which ones? I think there's always some way to isolate, even if ugly.

Almost all of them? You need referential transparency (via laziness) too, otherwise your attempt at isolation will break at the first binding expression in a local scope for future processing elsewhere:

    ...
    let arg = processData <$> ioAction
    in ...


 Do you want to wrap-and-call-later all of these cases into lambdas by hand? :)




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: