Include Session
fn include_session<N, C1, C2, A, B>(
session: Session<A>,
cont: impl FnOnce(N) -> PartialSession<C2, B>,
) -> PartialSession<C1, B>
N
is the length ofC1
.C1
is in the formHList![0: A0, 1: A1, ...]
C2
is in the formHList![0: A0, 1: A1, ..., N: A]
, withA
appended to the end ofC1
and the remaining elements unchanged.
Example
let p1: Session<End> = terminate();
let p2: Session<End> = include_session(p1, move |c| wait(c, terminate()));