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
In order to support the development of the session! macro to fulfill #30, we need to implement a more general form of type-level substitution, namely substituting an arbitrary session type for Done to "extend" a session. This is needed because the ; operator in the macro language does not necessarily have the information to expand out a type synonym within the context of the macro invocation, since the type could be defined elsewhere, yet it needs to substitute the continuation (everything after the ;) for every Done in the preceding type.
This must be implemented for even open session types like Continue. For instance, imagine the following:
This requires us to substitute Continue for Done in Q (due to the fact that our macro language implicitly loops if not break-ed), and then Q for Done in P.
Note that the de Bruijn index associated with the Continue is not incremented as it is substituted, because the types of P and Q don't contain Loops, but in general an auxiliary function to increment de Bruijn indices in the substituted terms is necessary to make Continues point to the correct place.
The text was updated successfully, but these errors were encountered:
In order to support the development of the
session!
macro to fulfill #30, we need to implement a more general form of type-level substitution, namely substituting an arbitrary session type forDone
to "extend" a session. This is needed because the;
operator in the macro language does not necessarily have the information to expand out a type synonym within the context of the macro invocation, since the type could be defined elsewhere, yet it needs to substitute the continuation (everything after the;
) for everyDone
in the preceding type.This must be implemented for even open session types like
Continue
. For instance, imagine the following:In this example, we would want to compile to:
This requires us to substitute
Continue
forDone
inQ
(due to the fact that our macro language implicitly loops if notbreak
-ed), and thenQ
forDone
inP
.Note that the de Bruijn index associated with the
Continue
is not incremented as it is substituted, because the types ofP
andQ
don't containLoop
s, but in general an auxiliary function to increment de Bruijn indices in the substituted terms is necessary to makeContinue
s point to the correct place.The text was updated successfully, but these errors were encountered: