We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion is to add a macro for writing the session types down.
Something like:
proto!{Atm, Client, ?<Id>, +[ act: &[ ?<u64>, !<u64>, act; ?<u64>, +[act; act]; !<u64>; eps ]; eps ] }
where
?<T>, P
Recv<T, P>
!<T>, P
Send<T, P>
+[A; B; C]
Choose<A, Choose<B, C>>
&[A; B; C]
Offer<A, Offer<B, C>>
t: P
Rec<P>
t
P
Var<N>
eps
Eps
The output of proto!() is then two type aliases:
proto!()
type Atm = ...; type Client = <Atm as HasDual>::Dual;
This should replace the current constructs like this:
type Atm = Recv<Id, Choose<Rec<AtmInner>, Eps>>; type AtmInner = Offer<AtmDeposit, Offer<AtmWithdraw, Offer<AtmBalance, Eps>>>; type AtmDeposit = Recv<u64, Send<u64, Var<Z>>>; type AtmWithdraw = Recv<u64, Choose<Var<Z>, Var<Z>>>; type AtmBalance = Send<u64, Var<Z>>; type Client = <Atm as HasDual>::Dual;
The text was updated successfully, but these errors were encountered:
Maybe more readable if labels were supported:
proto!{Atm, Client, ?<Id>, +[ act. &[ deposit: ?<u64>, !<u64>, act; withdraw: ?<u64>, +[ok: act; err: act]; balance: !<u64>; exit: eps ]; eps ] }
Recursion labels could then be followed by . and branch labels be followed by : to separate the two.
.
:
Sorry, something went wrong.
No branches or pull requests
Suggestion is to add a macro for writing the session types down.
Something like:
where
?<T>, P
denotesRecv<T, P>
!<T>, P
denotesSend<T, P>
+[A; B; C]
isChoose<A, Choose<B, C>>
&[A; B; C]
isOffer<A, Offer<B, C>>
t: P
should beRec<P>
. Any occurrences oft
inP
should be replaced with an appropriateVar<N>
constructeps
is justEps
The output of
proto!()
is then two type aliases:This should replace the current constructs like this:
The text was updated successfully, but these errors were encountered: