4 ms·
The laws are important though. They ensure that the "statement-like" things we build out of expressions do behave like statements. For example, it would be wei
by danidiaz 8y ago
The laws are important though. They ensure that the "statement-like" things we build out of expressions do behave like statements.
For example, it would be weird if we had three statements A B C that wrote to console, and sequencing A with B and then sequencing the result with C resulted in a different program than sequencing B with C and then sequencing A with the result.
Or, for non-IO things: it would be weird if we had three levels of nested lists, and concatenating two times "from the outside" resulted in a different list than concatenating each inner list first, and then the outer list.