@@ -104,12 +104,8 @@ import Control.Distributed.Static (RemoteTable, Closure)
104104--------------------------------------------------------------------------------
105105
106106-- | Node identifier
107−data NodeId = NodeId { nodeAddress :: !(NT.EndPointAddress) }
108− deriving (Eq, Ord)
109−
110−instance Binary NodeId where
111− put (NodeId nid) = put nid
112− get = NodeId <$> get
107+newtype NodeId = NodeId { nodeAddress :: NT.EndPointAddress }
108+ deriving (Eq, Ord, Binary)
113109
114110instance Show NodeId where
115111 show (NodeId addr) = "nid://" ++ show addr
@@ -117,8 +113,8 @@ instance Show NodeId where
117113-- | A local process ID consists of a seed which distinguishes processes from
118114-- different instances of the same local node and a counter
119115data LocalProcessId = LocalProcessId
120− { lpidUnique :: !Int32
121− , lpidCounter :: !Int32
116+ { lpidUnique :: {-# UNPACK #-} !Int32
117+ , lpidCounter :: {-# UNPACK #-} !Int32
122118 }
123119 deriving (Eq, Ord, Typeable, Show)
124120
@@ -127,7 +123,7 @@ data ProcessId = ProcessId
127123 { -- | The ID of the node the process is running on
128124 processNodeId :: !NodeId
129125 -- | Node-local identifier for the process
130− , processLocalId :: !LocalProcessId
126+ , processLocalId :: {-# UNPACK #-} !LocalProcessId
131127 }
132128 deriving (Eq, Ord, Typeable)
133129
@@ -218,9 +214,9 @@ type LocalSendPortId = Int32
218214-- to create a SendPort.
219215data SendPortId = SendPortId {
220216 -- | The ID of the process that will receive messages sent on this port
221− sendPortProcessId :: !ProcessId
217+ sendPortProcessId :: {-# UNPACK #-} !ProcessId
222218 -- | Process-local ID of the channel
223− , sendPortLocalId :: !LocalSendPortId
219+ , sendPortLocalId :: {-# UNPACK #-} !LocalSendPortId
224220 }
225221 deriving (Eq, Ord)
226222