Legend:

Which says it reads the two arguments and returns a freshly allocated `Int`

105

105

106

When we pass `(+)` as the first argument of `suspend2` the type system ends up with an ''effect class'' constraint `Pure !{!Read %r1; !Read %r2;}` which it satisfies by forcing `%r1` and `%r2` to be `Const`. If a value is in a `Const` region then it is guaranteed never to be destructively updated. This means that it doesn't matter when we read it, so the operation is pure.

106

When we pass `(+)` as the first argument of `suspend2` the type system encounters the ''effect class'' constraint `Pure !{!Read %r1; !Read %r2;}` which it satisfies by forcing `%r1` and `%r2` to be `Const`. If a value is in a `Const` region then it is guaranteed never to be destructively updated. This means that it doesn't matter when we read it, so the operation is pure.

107

107

108

108

To say this another way, when a function application is suspended the type system ''purifies'' its visible `Read` effects by requiring the data being read to be `Const`.