Skip to content

Commit

Permalink
Add Data deriving instance to NodeId and ProcessId, per suggestion of…
Browse files Browse the repository at this point in the history
… DylanLukes
  • Loading branch information
jepst committed Sep 25, 2011
1 parent a4eda0d commit 9ae60f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Remote/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ import Data.Char (isSpace,isDigit)
import Data.List (isSuffixOf,foldl', isPrefixOf,nub)
import Data.Maybe (catMaybes,isNothing)
import Data.Typeable (Typeable)
import Data.Data (Data)
import Data.Unique (newUnique,hashUnique)
import System.IO (Handle,hClose,hSetBuffering,hGetChar,hPutChar,BufferMode(..),hFlush)
import System.IO.Error (isEOFError,isDoesNotExistError,isUserError)
Expand Down Expand Up @@ -150,13 +151,13 @@ data Node = Node

-- | Identifies a node somewhere on the network. These
-- can be queried from 'getPeers'. See also 'getSelfNode'
data NodeId = NodeId !HostName !PortId deriving (Typeable,Eq,Ord)
data NodeId = NodeId !HostName !PortId deriving (Typeable,Eq,Ord,Data)

-- | Identifies a process somewhere on the network. These
-- are produced by the 'spawn' family of functions and
-- consumed by 'send'. When a process ends, its process ID
-- ceases to be valid. See also 'getSelfPid'
data ProcessId = ProcessId !NodeId !LocalProcessId deriving (Typeable,Eq,Ord)
data ProcessId = ProcessId !NodeId !LocalProcessId deriving (Typeable,Eq,Ord,Data)

instance Binary NodeId where
put (NodeId h p) = put h >> put p
Expand Down

0 comments on commit 9ae60f8

Please sign in to comment.