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


Ignore:
Timestamp:
Aug 26, 2010, 1:11:00 AM (9 years ago)
Author:
benl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Alpha/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`.