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