Changes between Version 6 and Version 7 of Language/Overview/ClassSystem
- Timestamp:
- 08/26/10 02:10:29 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Language/Overview/ClassSystem
v6 v7 104 104 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 en ds 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`.
