public static Session <S0, E, Cons <S0, L> > Goto <S0, E, L>(this Session <Call0, E, Cons <S0, L> > session) where S0 : SessionType where E : SessionStack where L : SessionList
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     return(session.ToNextSession <S0>());
 }
 public static Session <S8, Push <Z, E>, Cons <S0, Cons <S1, Cons <S2, Cons <S3, Cons <S4, Cons <S5, Cons <S6, Cons <S7, Cons <S8, L> > > > > > > > > > Call <S0, S1, S2, S3, S4, S5, S6, S7, S8, Z, E, L>(this Session <Call8 <Z>, E, Cons <S0, Cons <S1, Cons <S2, Cons <S3, Cons <S4, Cons <S5, Cons <S6, Cons <S7, Cons <S8, L> > > > > > > > > > session) where S0 : SessionType where S1 : SessionType where S2 : SessionType where S3 : SessionType where S4 : SessionType where S5 : SessionType where S6 : SessionType where S7 : SessionType where S8 : SessionType where Z : SessionType where E : SessionStack where L : SessionList
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     return(session.ToNextSession <S8, Push <Z, E> >());
 }
 public static Session <S2, Push <Z, E>, Cons <S0, Cons <S1, Cons <S2, L> > > > Call <S0, S1, S2, Z, E, L>(this Session <Call2 <Z>, E, Cons <S0, Cons <S1, Cons <S2, L> > > > session) where S0 : SessionType where S1 : SessionType where S2 : SessionType where Z : SessionType where E : SessionStack where L : SessionList
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     return(session.ToNextSession <S2, Push <Z, E> >());
 }
 public static Session <S, Push <Z, E>, S> Call <S, Z, E>(this Session <Call0 <Z>, E, S> session) where S : SessionType where Z : SessionType where E : SessionStack
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     return(session.ToNextSession <S, Push <Z, E> >());
 }
Example #5
0
 public static Session <S, E, P> Let <S, E, P, T>(this Session <S, E, P> session, out T variable, T value) where S : SessionType where E : SessionStack where P : ProtocolType
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     variable = value;
     return(session.Duplicate());
 }
Example #6
0
 public static Session <S, E, P> Wait <S, E, P>(this Session <S, E, P> session) where S : SessionType where E : SessionStack where P : ProtocolType
 {
     if (session is null)
     {
         throw new ArgumentNullException(nameof(session));
     }
     session.CallSimply();
     session.WaitForLastTask();
     return(session.Duplicate());
 }
Example #7
0
        public static async Task <Session <S, E, P> > Sync <S, E, P>(this Session <S, E, P> session) where S : SessionType where E : SessionStack where P : ProtocolType
        {
            if (session is null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            session.CallSimply();
            await session.AwaitLastTask();

            return(session.Duplicate());
        }
        public static Session <Z, E, Cons <S0, Cons <S1, Cons <S2, Cons <S3, Cons <S4, Cons <S5, Cons <S6, Cons <S7, Cons <S8, Cons <S9, L> > > > > > > > > > > Call <S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, Z, E, L>(this Session <Call9 <Z>, E, Cons <S0, Cons <S1, Cons <S2, Cons <S3, Cons <S4, Cons <S5, Cons <S6, Cons <S7, Cons <S8, Cons <S9, L> > > > > > > > > > > session, DepletionFunc <S9, Cons <S0, Cons <S1, Cons <S2, Cons <S3, Cons <S4, Cons <S5, Cons <S6, Cons <S7, Cons <S8, Cons <S9, L> > > > > > > > > > > depletion) where S0 : SessionType where S1 : SessionType where S2 : SessionType where S3 : SessionType where S4 : SessionType where S5 : SessionType where S6 : SessionType where S7 : SessionType where S8 : SessionType where S9 : SessionType where Z : SessionType where E : SessionStack where L : SessionList
        {
            if (session is null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (depletion is null)
            {
                throw new ArgumentNullException(nameof(depletion));
            }
            session.CallSimply();
            var depleted = depletion(session.ToNextSession <S9, Any>(), depletion);

            depleted.CallSimply();
            return(depleted.ToNextSession <Z, E>());
        }
        public static Session <Z, E, Cons <S0, Cons <S1, Cons <S2, L> > > > Call <S0, S1, S2, Z, E, L>(this Session <Call2 <Z>, E, Cons <S0, Cons <S1, Cons <S2, L> > > > session, DepletionFunc <S2, Cons <S0, Cons <S1, Cons <S2, L> > > > depletion) where S0 : SessionType where S1 : SessionType where S2 : SessionType where Z : SessionType where E : SessionStack where L : SessionList
        {
            if (session is null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (depletion is null)
            {
                throw new ArgumentNullException(nameof(depletion));
            }
            session.CallSimply();
            var depleted = depletion(session.ToNextSession <S2, Any>(), depletion);

            depleted.CallSimply();
            return(depleted.ToNextSession <Z, E>());
        }
        public static Session <Z, E, S> Call <S, Z, E>(this Session <Call0 <Z>, E, S> session, DepletionFunc <S, S> depletion) where S : SessionType where Z : SessionType where E : SessionStack
        {
            if (session is null)
            {
                throw new ArgumentNullException(nameof(session));
            }
            if (depletion is null)
            {
                throw new ArgumentNullException(nameof(depletion));
            }
            session.CallSimply();
            var depleted = depletion(session.ToNextSession <S, Any>(), depletion);

            depleted.CallSimply();
            return(depleted.ToNextSession <Z, E>());
        }