Changes between Version 7 and Version 8 of Language/Overview/ClassSystem

Show
Ignore:
Timestamp:
08/26/10 02:11:00 (4 years ago)
Author:
benl (IP: 203.206.176.236)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Language/Overview/ClassSystem

    v7 v8  
    104104Which says it reads the two arguments and returns a freshly allocated `Int` 
    105105 
    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. 
     106When we pass `(+)` as the first argument of `suspend2` the type system encounters the ''effect class'' constraint `Pure !{!Read %r1; !Read %r2;}`. This is then satisfied by constraining `%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. 
    107107 
    108108To 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`.