sessions-2008.2.23: Session Types for Haskell

Control.Concurrent.Session.SMonad

Description

Super magic Monads.

Synopsis

Documentation

newtype SChain m x y a Source

Constructors

SChain 

Fields

runSChain :: x -> m (a, y)
 

Instances

MonadIO m => SMonadIO (SChain m) 
Monad m => SMonad (SChain m) 
Monad m => Monad (SChain m x x) 

class SMonad m whereSource

An extension of the typical Monad such that you track additional from and to parameters. Thus you can think of this like State where the type of the State varies.

Methods

(~>>) :: m x y a -> m y z b -> m x z bSource

(~>>=) :: m x y a -> (a -> m y z b) -> m x z bSource

sreturn :: a -> m x x aSource

Instances

Monad m => SMonad (SChain m) 
SMonad m => SMonad (SStateT s m) 
(Dual prog prog', ProgramToMVarsOutgoing prog progOut, ProgramToMVarsOutgoing prog' progIn) => SMonad (SessionChain prog progOut progIn) 

newtype SStateT s m x y a Source

Constructors

SStateT 

Fields

runSStateT :: s -> m x y (a, s)
 

Instances

class SMonadTrans t whereSource

Methods

slift :: SMonad m => m x y a -> t m x y aSource

Instances

class SMonad m => SMonadIO m whereSource

Methods

sliftIO :: IO a -> m x x aSource

Instances

MonadIO m => SMonadIO (SChain m) 
(Dual prog prog', ProgramToMVarsOutgoing prog progOut, ProgramToMVarsOutgoing prog' progIn) => SMonadIO (SessionChain prog progOut progIn) 

class SMonad m => SMonadState s m | m -> s whereSource

Methods

sget :: m x x sSource

sput :: s -> m x x ()Source

Instances

SMonad m => SMonadState s (SStateT s m)