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
To continue exploring expressivity from issue #5, let us consider the notion of latent effects from "Staged Effects and Handlers for Modular Languages with Abstraction" by Casper Bach Poulsen, Cas van der Rest and Tom Schrijvers (link to their repo on github).
They consider an effectful program with lambda bindings:
prog:: (Lam:?e, StateVal:?e) =>EffeVal
prog =do
put (IntVal0)
clos <- lambda "x" get -- the x argument is ignored
put (IntVal42)
apply clos (IntVal0)
Assuming these definitions exist (they can probably be implemented with the scoped effects technique from #5):
If we now handle the State effect first then in the normal view the get will be evaluated under the lambda and become the constant value 0. Then handling Lam will yield the result IntVal 0.
But we would like to be able to handle our functions in such a way that the get under the lambda will be delayed or treated as a latent effect that is only evaluated at the place where the lambda is applied. Then the result should be IntVal 42.
The text was updated successfully, but these errors were encountered:
To continue exploring expressivity from issue #5, let us consider the notion of latent effects from "Staged Effects and Handlers for Modular Languages with Abstraction" by Casper Bach Poulsen, Cas van der Rest and Tom Schrijvers (link to their repo on github).
They consider an effectful program with lambda bindings:
Assuming these definitions exist (they can probably be implemented with the scoped effects technique from #5):
And
Val
is some value type of an embedded language that supports function closures and integer constants. E.g.:If we now handle the
State
effect first then in the normal view theget
will be evaluated under the lambda and become the constant value 0. Then handlingLam
will yield the resultIntVal 0
.But we would like to be able to handle our functions in such a way that the
get
under the lambda will be delayed or treated as a latent effect that is only evaluated at the place where the lambda is applied. Then the result should beIntVal 42
.The text was updated successfully, but these errors were encountered: