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

Could you say something about why `unsafePerformIO` is unsafe in the presence of laziness?

I know `unsafePerformIO` can be used to violate the type system in combination with `IORef`s, for example, but I don't see what laziness has to do with it.



In the presence of laziness, it can be very difficult to reason about what code executes when. When you don't know when your unsafe IO happens, things can get out of order or have other unforeseen side effects.




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

Search: