You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interpose currrently has the "local" semantics of swapping handlers. That is, effects introduced outside of the scope of interpose will not have their dependency handlers swapped. This allows us to "overlay" behaviors on existing handlers.
However, it is also useful to have the "global" semantics of swapping handlers: all effects, in scope or out of scope, will have their dependency handlers swapped. This behavior is crucial in the implementation of scoped effects.
replace::e:>es=>Handlerees->Effes~>Effes
replace handle m =Eff\es@(Env _ re _) ->let ix =Rec.index re
in unEff m $ updateEnv ix (mkInternalHandler ix es m)
The text was updated successfully, but these errors were encountered:
So that the replace function can be used to implement the toEffWith functions. There will be possible performance degradation though so we need to benchmark first.
Another problem is that this introduces problem for interpose: any call to the "overlaid" effect need to be wrapped in raise. This is not a performance concern but certainly not good ergonomics.
No - this is a terrible idea. Effect handlers calling themselves recursively is minimally useful and can confuse newbies. toEffWith is already expressive enough.
interpose
currrently has the "local" semantics of swapping handlers. That is, effects introduced outside of the scope ofinterpose
will not have their dependency handlers swapped. This allows us to "overlay" behaviors on existing handlers.However, it is also useful to have the "global" semantics of swapping handlers: all effects, in scope or out of scope, will have their dependency handlers swapped. This behavior is crucial in the implementation of scoped effects.
The text was updated successfully, but these errors were encountered: