| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Distributed.Session.Session
Contents
Description
This module defines the Session session typed indexed monad.
- newtype Session s r a = Session {
- runSessionC :: Maybe SessionInfo -> IxC Process s r a
- data SessionInfo = SessionInfo {}
- runSession :: Session s r a -> Maybe SessionInfo -> STTerm Process s r a
- liftP :: Process a -> Session s s a
- liftST :: STTerm Process s r a -> Session s r a
Data types
newtype Session s r a Source #
Session is defined as a newtype wrapper over a function that takes a `Maybe SessionInfo` and returns an indexed codensity monad transformer over the Process monad.
Session is also a reader monad that has a Maybe SessionInfo as its environment. SessionInfo is wrapped in a Maybe, because we also allow a session to be run singularly.
In which case there is no other Session to communicate with and therefore is there also no need for a SessionInfo.
The function returns the indexed codensity monad and not simply a STTerm, because from benchmarking the codensity monad gave us significant performance improvements for free.
Constructors
| Session | |
Fields
| |
data SessionInfo Source #
The SessionInfo data type tells us information about another Session. Namely, the Session that is in a session with the Session that this specific SessionInfo belongs to.
Constructors
| SessionInfo | |
Fields | |
Instances
runSession :: Session s r a -> Maybe SessionInfo -> STTerm Process s r a Source #
Evaluates a session to a STTerm