I understand from this blog post how a single shift within a reset is reified.
reset { 1 + shift {k:Int => Int => k(5)} + 1}
is reified to
val reified = {shiftValue:Int => 1 + shiftValue + 1}; reified (5)
Now I have another example:
reset {
1 + shift(k1:Int => Int => k1(5)} + 1;
2 + shift(k2:Int => Int => k2(6)} + 2
}
It is reified to:
val reified ={shifyValue1:Int =>
1 + shiftValue + 1;
2 + shift(k2:Int => Int => k2(6)} + 2
}
reified(5)
How can I reify it further to get rid of the 2nd shift?
Basically the same transformation.
(scala not installed here, so I only tested this transformation in Scheme, which should behave the same, ignoring any type system issues.)