Permalink
Browse files

move forever' into Type.hs for general use

  • Loading branch information...
1 parent ebd65bb commit 5c3abffa07d874c4e2e7245874af22ffc2af2007 @hyperthunk hyperthunk committed Jan 24, 2013
@@ -67,6 +67,8 @@ module Control.Distributed.Process.Internal.Types
, channelCounter
, typedChannels
, typedChannelWithId
+ -- * Utilities
+ , forever'
) where
import System.Mem.Weak (Weak)
@@ -625,3 +627,13 @@ typedChannels = accessor _typedChannels (\cs st -> st { _typedChannels = cs })
typedChannelWithId :: LocalSendPortId -> Accessor LocalProcessState (Maybe TypedChannel)
typedChannelWithId cid = typedChannels >>> DAC.mapMaybe cid
+
+--------------------------------------------------------------------------------
+-- Utilities --
+--------------------------------------------------------------------------------
+
+-- Like 'Control.Monad.forever' but sans space leak
+{-# INLINE forever' #-}
+forever' :: Monad m => m a -> m b
+forever' a = let a' = a >> a' in a'
+
@@ -109,6 +109,7 @@ import Control.Distributed.Process.Internal.Types
, localPidUnique
, localProcessWithId
, localConnections
+ , forever'
, MonitorRef(..)
, ProcessMonitorNotification(..)
, NodeMonitorNotification(..)
@@ -202,11 +203,6 @@ createBareLocalNode endPoint rtable = do
void . forkIO $ handleIncomingMessages node
return node
--- Like 'Control.Monad.forever' but sans space leak
-{-# INLINE forever' #-}
-forever' :: Monad m => m a -> m b
-forever' a = let a' = a >> a' in a'
-
-- | Start and register the service processes on a node
-- (for now, this is only the logger)
startServiceProcesses :: LocalNode -> IO ()

0 comments on commit 5c3abff

Please sign in to comment.