Just a warning for newcomers who follow after me. I spent about four hours yesterday desperately trying to figure out a bug that turned out to be the fact that execution order is unspecified.
I know, all of you who have been using the language for more than eight and a half minutes knew this already, and it is indeed documented, but it’s an unexpected enough sort of thing to the naive that it’s probably worth mentioning, in any tutorial or book, just as soon as you start mentioning side effects, in nice bold letters, perhaps with a “don’t say we didn’t warn you if you forget about this!” attached.
Just in case someone coming after me is tearing their hair out and finds this via google:
g have side effects,
f a :: g b
might not (indeed, probably will not!) end up executing
g, and you need to do something like:
let x = f a in let y = g b in x :: y
g to execute in the order you are naively expecting.