(I hope this question is on-topic -- I tried searching for an answer but didn\'t find a definitive answer. If this happens to be off-topic or already answered, please mo
In addition to what other's have already mentioned, having side-effecting actions be first-class is sometimes useful. Here's a silly example to show the idea:
f = sequence_ (reverse [print 1, print 2, print 3])
This example shows how you can build up computations with side-effects (in this example print
) and then put the in data structures or manipulate them in other ways, before actually executing them.