git.iko.soy/distributed-process
on master help sign in
Improve documentation
aed9b82Edsko de Vries
distributed-process/distributed-process.cabal+2−3
@@ -16,9 +16,8 @@ Description: This is an implementation of Cloud Haskell, as described in
16 and Simon Peyton Jones
16 and Simon Peyton Jones
17 (<http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/>),
17 (<http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/>),
18 although some of the details are different. The precise message
18 although some of the details are different. The precise message
19− passing semantics are based on /A unified semantics for future
19+ passing semantics are based on /A unified semantics for future Erlang/
20− Erlang/ by Hans Svensson, Lars-Åke Fredlund and Clara Benac
20+ by Hans Svensson, Lars-Åke Fredlund and Clara Benac Earle.
21− Earle.
22
21
23 You will probably also want to install a Cloud Haskell backend such
22 You will probably also want to install a Cloud Haskell backend such
24 as distributed-process-simplelocalnet.
23 as distributed-process-simplelocalnet.
distributed-process/src/Control/Distributed/Process/Internal/Types.hs+13−2
@@ -135,7 +135,9 @@ instance Show LocalProcessId where
135
135
136-- | Process identifier
136-- | Process identifier
137data ProcessId = ProcessId
137data ProcessId = ProcessId
138+ { -- | The ID of the node the process is running on
138− { processNodeId :: NodeId
139+ processNodeId :: NodeId
140+ -- | Node-local identifier for the process
139 , processLocalId :: LocalProcessId
141 , processLocalId :: LocalProcessId
140 }
142 }
141 deriving (Eq, Ord, Typeable)
143 deriving (Eq, Ord, Typeable)
@@ -218,8 +220,14 @@ procMsg = Process . Trans.lift
218
220
219type LocalSendPortId = Int32
221type LocalSendPortId = Int32
220
222
223+-- | A send port is identified by a SendPortId.
224+--
225+-- You cannot send directly to a SendPortId; instead, use 'newChan'
226+-- to create a SendPort.
221data SendPortId = SendPortId {
227data SendPortId = SendPortId {
228+ -- | The ID of the process that will receive messages sent on this port
222 sendPortProcessId :: ProcessId
229 sendPortProcessId :: ProcessId
230+ -- | Process-local ID of the channel
223 , sendPortLocalId :: LocalSendPortId
231 , sendPortLocalId :: LocalSendPortId
224 }
232 }
225 deriving (Eq, Ord)
233 deriving (Eq, Ord)
@@ -231,7 +239,10 @@ instance Show SendPortId where
231data TypedChannel = forall a. Serializable a => TypedChannel (TChan a)
239data TypedChannel = forall a. Serializable a => TypedChannel (TChan a)
232
240
233-- | The send send of a typed channel (serializable)
241-- | The send send of a typed channel (serializable)
234−newtype SendPort a = SendPort { sendPortId :: SendPortId }
242+newtype SendPort a = SendPort {
243+ -- | The (unique) ID of this send port
244+ sendPortId :: SendPortId
245+ }
235 deriving (Typeable, Binary, Show, Eq, Ord)
246 deriving (Typeable, Binary, Show, Eq, Ord)
236
247
237-- | The receive end of a typed channel (not serializable)
248-- | The receive end of a typed channel (not serializable)