sessions-2008.5.12: Session Types for HaskellSource codeContentsIndex
Control.Concurrent.Session.Base.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 ()
ssequence_ :: SMonad m => [m x x a] -> m x x ()
ssequence :: SMonad m => [m x x a] -> m x x [a]
sjoin :: SMonad m => m x y (m y z b) -> m x z b
smapM :: SMonad m => (a -> m x x b) -> [a] -> m x x [b]
smapM_ :: SMonad m => (a -> m x x b) -> [a] -> 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
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
class SMonad m => SMonadState s m | m -> s whereSource
Methods
sget :: m x x sSource
sput :: s -> m x x ()Source
show/hide Instances
ssequence_ :: SMonad m => [m x x a] -> m x x ()Source
ssequence :: SMonad m => [m x x a] -> m x x [a]Source
sjoin :: SMonad m => m x y (m y z b) -> m x z bSource
smapM :: SMonad m => (a -> m x x b) -> [a] -> m x x [b]Source
smapM_ :: SMonad m => (a -> m x x b) -> [a] -> m x x ()Source
Produced by Haddock version 2.4.2