@@ -461,9 +461,11 @@ data PortLinkException =
461461
462462-- | Exception thrown when a process attempts to register
463463-- a process under an already-registered name or to
464−-- unregister a name that hasn't been registered
464+-- unregister a name that hasn't been registered. Returns
465+-- the name and the identifier of the process that owns it,
466+-- if any.
465467data ProcessRegistrationException =
466− ProcessRegistrationException !String
468+ ProcessRegistrationException !String !(Maybe ProcessId)
467469 deriving (Typeable, Show)
468470
469471-- | Internal exception thrown indirectly by 'exit'
@@ -524,7 +526,7 @@ data WhereIsReply = WhereIsReply String (Maybe ProcessId)
524526 deriving (Show, Typeable)
525527
526528-- | (Asynchronous) reply from 'register' and 'unregister'
527−data RegisterReply = RegisterReply String Bool
529+data RegisterReply = RegisterReply String Bool (Maybe ProcessId)
528530 deriving (Show, Typeable)
529531
530532data NodeStats = NodeStats {
@@ -693,8 +695,8 @@ instance Binary WhereIsReply where
693695 get = WhereIsReply <$> get <*> get
694696
695697instance Binary RegisterReply where
696− put (RegisterReply label ok) = put label >> put ok
697− get = RegisterReply <$> get <*> get
698+ put (RegisterReply label ok owner) = put label >> put ok >> put owner
699+ get = RegisterReply <$> get <*> get <*> get
698700
699701instance Binary ProcessInfo where
700702 get = ProcessInfo <$> get <*> get <*> get <*> get <*> get
@@ -761,4 +763,3 @@ typedChannelWithId cid = typedChannels >>> DAC.mapMaybe cid
761763{-# INLINE forever' #-}
762764forever' :: Monad m => m a -> m b
763765forever' a = let a' = a >> a' in a'
764−