@@ -77,7 +77,7 @@ module Control.Distributed.Process.Internal.Primitives
7777 , monitor
7878 , unmonitor
7979 , withMonitor
80− , withMonitorRef
80+ , withMonitor_
8181 -- * Logging
8282 , say
8383 -- * Registry
@@ -887,21 +887,19 @@ monitor = monitor' . ProcessIdentifier
887887-- @withMonitor@ returns, there might still be unreceived monitor
888888-- messages in the queue.
889889--
890−withMonitor :: ProcessId -> Process a -> Process a
891−withMonitor pid = withMonitorRef pid . const
892− -- unmonitor blocks waiting for the response, so there's a possibility
893− -- that an exception might interrupt withMonitor before the unmonitor
894− -- has completed. I think that's better than making the unmonitor
895− -- uninterruptible.
890+withMonitor :: ProcessId -> (MonitorRef -> Process a) -> Process a
891+withMonitor pid = bracket (monitor pid) unmonitor
896892
897893-- | Establishes temporary monitoring of another process.
898894--
899−-- @withMonitorRef pid code@ sets up monitoring of @pid@ for the duration
900−-- of @code@. Note: although monitoring is no longer active when
901−-- @withMonitorRef@ returns, there might still be unreceived monitor
895+-- @withMonitor_ pid code@ sets up monitoring of @pid@ for the duration
896+-- of @code@. Note: although monitoring is no longer active when
897+-- @withMonitor_@ returns, there might still be unreceived monitor
902898-- messages in the queue.
903−withMonitorRef :: ProcessId -> (MonitorRef -> Process a) -> Process a
904−withMonitorRef pid code = bracket (monitor pid) unmonitor code
899+--
900+-- Since 0.6.1
901+withMonitor_ :: ProcessId -> Process a -> Process a
902+withMonitor_ p = withMonitor p . const
905903
906904-- | Remove a link
907905--