Copyright | (C) 2016, The University of Kansas |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Andy Gill |
Stability | Alpha |
Portability | GHC |
Safe Haskell | Safe |
Language | Haskell2010 |
- data RemoteMonad c p a
- command :: c -> RemoteMonad c p ()
- procedure :: p a -> RemoteMonad c p a
- class RunMonad f where
- runMonad :: Monad m => (f c p ~> m) -> RemoteMonad c p ~> m
- runWeakMonad :: Monad m => (WeakPacket c p ~> m) -> RemoteMonad c p ~> m
- runStrongMonad :: forall m c p. Monad m => (StrongPacket c p ~> m) -> RemoteMonad c p ~> m
- runApplicativeMonad :: forall m c p. Monad m => (ApplicativePacket c p ~> m) -> RemoteMonad c p ~> m
- runMonadSkeleton :: Monad m => (RemoteApplicative c p ~> m) -> RemoteMonad c p ~> m
The remote monad
data RemoteMonad c p a Source
RemoteMonad
is our monad that can be executed in a remote location.
Monad (RemoteMonad c p) Source | |
Functor (RemoteMonad c p) Source | |
Applicative (RemoteMonad c p) Source |
The primitive lift functions
command :: c -> RemoteMonad c p () Source
promote a command into the remote monad
procedure :: p a -> RemoteMonad c p a Source
promote a procedure into the remote monad
The run functions
runWeakMonad :: Monad m => (WeakPacket c p ~> m) -> RemoteMonad c p ~> m Source
This is the classic weak remote monad, or technically the weak remote applicative weak remote monad.
runStrongMonad :: forall m c p. Monad m => (StrongPacket c p ~> m) -> RemoteMonad c p ~> m Source
This is the classic strong remote monad. It bundles
packets (of type StrongPacket
) as large as possible,
including over some monadic binds.
runApplicativeMonad :: forall m c p. Monad m => (ApplicativePacket c p ~> m) -> RemoteMonad c p ~> m Source
The is the strong applicative strong remote monad. It bundles
packets (of type RemoteApplicative
) as large as possible,
including over some monadic binds.
runMonadSkeleton :: Monad m => (RemoteApplicative c p ~> m) -> RemoteMonad c p ~> m Source
This is a remote monad combinator, that takes an implementation
of a remote applicative, splits the monad into applicatives
without any merge stragegy, and uses the remote applicative.
Every >>=
will generate a call to the RemoteApplicative
handler; as well as one terminating call.
Using runBindeeMonad
with a runWeakApplicative
gives the weakest remote monad.