3 ms·
Evaluation order is somewhat "dependency driven" in Haskell for pure functions, because it uses lazy evaluation. But in this case the code here is basically ge
by pxeger1 4y ago
Evaluation order is somewhat "dependency driven" in Haskell for pure functions, because it uses lazy evaluation.
But in this case the code here is basically generating a list of "instructions" for the Haskell runtime, like saying "first open the file, then say hello, then read the file".
The generation of the instructions may be in an undefined order, but that doesn't matter, because writing the instructions doesn't in itself produce any side effects.
The resulting list of instructions ends up listed in the order you wrote, and so the actual IO effects are executed in that order.