@@ -104,12 +104,8 @@ import Control.Distributed.Static (RemoteTable, Closure)
104--------------------------------------------------------------------------------
104--------------------------------------------------------------------------------
106-- | Node identifier
106-- | Node identifier
107−data NodeId = NodeId { nodeAddress :: !(NT.EndPointAddress) }
107+newtype NodeId = NodeId { nodeAddress :: NT.EndPointAddress }
108− deriving (Eq, Ord)
108+ deriving (Eq, Ord, Binary)
110−instance Binary NodeId where
111− put (NodeId nid) = put nid
112− get = NodeId <$> get
114instance Show NodeId where
110instance Show NodeId where
115 show (NodeId addr) = "nid://" ++ show addr
111 show (NodeId addr) = "nid://" ++ show addr
@@ -117,8 +113,8 @@ instance Show NodeId where
117-- | A local process ID consists of a seed which distinguishes processes from
113-- | A local process ID consists of a seed which distinguishes processes from
118-- different instances of the same local node and a counter
114-- different instances of the same local node and a counter
119data LocalProcessId = LocalProcessId
115data LocalProcessId = LocalProcessId
120− { lpidUnique :: !Int32
116+ { lpidUnique :: {-# UNPACK #-} !Int32
121− , lpidCounter :: !Int32
117+ , lpidCounter :: {-# UNPACK #-} !Int32
123 deriving (Eq, Ord, Typeable, Show)
119 deriving (Eq, Ord, Typeable, Show)
@@ -127,7 +123,7 @@ data ProcessId = ProcessId
127 { -- | The ID of the node the process is running on
123 { -- | The ID of the node the process is running on
128 processNodeId :: !NodeId
124 processNodeId :: !NodeId
129 -- | Node-local identifier for the process
125 -- | Node-local identifier for the process
130− , processLocalId :: !LocalProcessId
126+ , processLocalId :: {-# UNPACK #-} !LocalProcessId
132 deriving (Eq, Ord, Typeable)
128 deriving (Eq, Ord, Typeable)
@@ -218,9 +214,9 @@ type LocalSendPortId = Int32
218-- to create a SendPort.
214-- to create a SendPort.
219data SendPortId = SendPortId {
215data SendPortId = SendPortId {
220 -- | The ID of the process that will receive messages sent on this port
216 -- | The ID of the process that will receive messages sent on this port
221− sendPortProcessId :: !ProcessId
217+ sendPortProcessId :: {-# UNPACK #-} !ProcessId
222 -- | Process-local ID of the channel
218 -- | Process-local ID of the channel
223− , sendPortLocalId :: !LocalSendPortId
219+ , sendPortLocalId :: {-# UNPACK #-} !LocalSendPortId
225 deriving (Eq, Ord)
221 deriving (Eq, Ord)