distributed-process-0.2.1.2: Cloud Haskell: Erlang-style concurrency in Haskell

Safe HaskellNone

Control.Distributed.Process.Internal.Closure.CP

Contents

Description

Combinator for process closures

Synopsis

Definition of CP and the generalized arrow combinators

type CP a b = Closure (a -> Process b)Source

'CP a b' represents the closure of a process parameterized by a and returning b. 'CP a b' forms a (restricted) generalized arrow (http://www.cs.berkeley.edu/~megacz/garrows/)

cpIntro :: forall a b. (Typeable a, Typeable b) => Closure (Process b) -> Closure (a -> Process b)Source

CP introduction form

cpElim :: forall a. Typeable a => CP () a -> Closure (Process a)Source

CP elimination form

cpId :: Typeable a => CP a aSource

Identity (Closure version of return)

cpComp :: forall a b c. (Typeable a, Typeable b, Typeable c) => CP a b -> CP b c -> CP a cSource

Left-to-right composition (Closure version of >=>)

cpFirst :: forall a b c. (Typeable a, Typeable b, Typeable c) => CP a b -> CP (a, c) (b, c)Source

First

cpSecond :: forall a b c. (Typeable a, Typeable b, Typeable c) => CP a b -> CP (c, a) (c, b)Source

Second

cpSplit :: (Typeable a, Typeable b, Typeable c, Typeable d) => CP a c -> CP b d -> CP (a, b) (c, d)Source

Split (Like ***)

cpCancelL :: Typeable a => CP ((), a) aSource

Left cancellation

cpCancelR :: Typeable a => CP (a, ()) aSource

Right cancellation

Closure versions of CH primitives

cpLink :: ProcessId -> Closure (Process ())Source

Closure version of link

cpUnlink :: ProcessId -> Closure (Process ())Source

Closure version of unlink

cpSend :: forall a. Typeable a => Static (SerializableDict a) -> ProcessId -> Closure (a -> Process ())Source

Closure version of send

cpExpect :: Typeable a => Static (SerializableDict a) -> Closure (Process a)Source

Closure version of expect

Closure (Process a) as a not-quite-monad

cpReturn :: forall a. Serializable a => Static (SerializableDict a) -> a -> Closure (Process a)Source

Not-quite-monadic return

cpBind :: forall a b. (Typeable a, Typeable b) => Closure (Process a) -> Closure (a -> Process b) -> Closure (Process b)Source

Not-quite-monadic bind (>>=)

cpSeq :: Closure (Process ()) -> Closure (Process ()) -> Closure (Process ())Source

Monadic sequencing (>>)

Runtime support