3 ms·
Lazy IO refers to a set of functions like readFile that explicitly break that abstraction, tying observable IO to the order expressions are evaluated. Under the
by tikhonj 7y ago
Lazy IO refers to a set of functions like readFile that explicitly break that abstraction, tying observable IO to the order expressions are evaluated. Under the hood, the lazy IO functions rely on a GHC function called unsafeInterleaveIO, whose name hints at how it works and that it's not safe.
The fact that lazy IO behaves so unintuitively and causes significant problems strongly signals that that particular abstraction shouldn't be broken.