@@ -461,9 +461,11 @@ data PortLinkException =
462-- | Exception thrown when a process attempts to register
462-- | Exception thrown when a process attempts to register
463-- a process under an already-registered name or to
463-- 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,
465data ProcessRegistrationException =
467data ProcessRegistrationException =
466− ProcessRegistrationException !String
468+ ProcessRegistrationException !String !(Maybe ProcessId)
467 deriving (Typeable, Show)
469 deriving (Typeable, Show)
469-- | Internal exception thrown indirectly by 'exit'
471-- | Internal exception thrown indirectly by 'exit'
@@ -524,7 +526,7 @@ data WhereIsReply = WhereIsReply String (Maybe ProcessId)
524 deriving (Show, Typeable)
526 deriving (Show, Typeable)
526-- | (Asynchronous) reply from 'register' and 'unregister'
528-- | (Asynchronous) reply from 'register' and 'unregister'
527−data RegisterReply = RegisterReply String Bool
529+data RegisterReply = RegisterReply String Bool (Maybe ProcessId)
528 deriving (Show, Typeable)
530 deriving (Show, Typeable)
530data NodeStats = NodeStats {
532data NodeStats = NodeStats {
@@ -693,8 +695,8 @@ instance Binary WhereIsReply where
693 get = WhereIsReply <$> get <*> get
695 get = WhereIsReply <$> get <*> get
695instance Binary RegisterReply where
697instance Binary RegisterReply where
696− put (RegisterReply label ok) = put label >> put ok
698+ put (RegisterReply label ok owner) = put label >> put ok >> put owner
697− get = RegisterReply <$> get <*> get
699+ get = RegisterReply <$> get <*> get <*> get
699instance Binary ProcessInfo where
701instance Binary ProcessInfo where
700 get = ProcessInfo <$> get <*> get <*> get <*> get <*> get
702 get = ProcessInfo <$> get <*> get <*> get <*> get <*> get
@@ -761,4 +763,3 @@ typedChannelWithId cid = typedChannels >>> DAC.mapMaybe cid
761{-# INLINE forever' #-}
763{-# INLINE forever' #-}
762forever' :: Monad m => m a -> m b
764forever' :: Monad m => m a -> m b
763forever' a = let a' = a >> a' in a'
765forever' a = let a' = a >> a' in a'