sessions-2008.2.28: Session Types for HaskellSource codeContentsIndex
Control.Concurrent.Session.SMonad
Description
Super magic Monads.
Synopsis
newtype SChain m x y a = SChain {
runSChain :: x -> m (a, y)
}
class SMonad m where
(~>>) :: m x y a -> m y z b -> m x z b
(~>>=) :: m x y a -> (a -> m y z b) -> m x z b
sreturn :: a -> m x x a
newtype SStateT s m x y a = SStateT {
runSStateT :: s -> m x y (a, s)
}
class SMonadTrans t where
slift :: SMonad m => m x y a -> t m x y a
class SMonad m => SMonadIO m where
sliftIO :: IO a -> m x x a
class SMonad m => SMonadState s m | m -> s where
sget :: m x x s
sput :: s -> m x x ()
Documentation
newtype SChain m x y a Source
Constructors
SChain
runSChain :: x -> m (a, y)
show/hide 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
show/hide 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
runSStateT :: s -> m x y (a, s)
show/hide Instances
class SMonadTrans t whereSource
Methods
slift :: SMonad m => m x y a -> t m x y aSource
show/hide Instances
class SMonad m => SMonadIO m whereSource
Methods
sliftIO :: IO a -> m x x aSource
show/hide 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
show/hide Instances
Produced by Haddock version 2.3.0