sessiontypes-distributed-0.1.0: Package for annotating Cloud Haskell programs

Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Session.Eval

Description

This module defines two interpreters for mapping the Cloud Haskell semantics to the constructors of STTerm.

Synopsis

Documentation

evalSession :: forall s r a. HasConstraint Serializable s => Session s r a -> SessionInfo -> Process a Source #

This function unpacks a Session to a STTerm using a given SessionInfo.

It then evaluates the STTerm by mapping Cloud Haskell semantics to each constructor of STTerm.

The function relies on that there exists another session (on a different process) that is also being evaluated (using evalSession) and acts as the dual the session that function is now evaluating.

The underlying communication method is a session typed channel (STChannelT). There should be no interference from other processes, unless you go through the effort of sharing the send port.

evalSessionEq :: Session s s a -> Process a Source #

Similar to evalSession, except for that it does not evaluate session typed actions.

Only returns and lifted computations are evaluated. This also means that there does not need to be a dual session that is evaluated on a different process.

It also assumes that SessionInfo is not used. Use evalSessionEq' if this is not the case.

evalSessionEq' :: Session s s a -> SessionInfo -> Process a Source #

Same as evalSessionEq, but you may now provide a SessionInfo.