git.iko.soy/distributed-process
on master help sign in
Make -Wall clean.
426beefMathieu Boespflug
src/Control/Distributed/Process/Internal/Messaging.hs+1−2
@@ -18,7 +18,7 @@ import Control.Distributed.Process.Serializable ()
18
18
19import Control.Concurrent.Chan (writeChan)
19import Control.Concurrent.Chan (writeChan)
20import Control.Monad (unless)
20import Control.Monad (unless)
21−import Control.Monad.IO.Class (MonadIO, liftIO)
21+import Control.Monad.IO.Class (liftIO)
22import Control.Monad.Reader (ask)
22import Control.Monad.Reader (ask)
23import qualified Network.Transport as NT
23import qualified Network.Transport as NT
24 ( Connection
24 ( Connection
@@ -195,4 +195,3 @@ sendCtrlMsg mNid signal = do
195 (NodeIdentifier nid)
195 (NodeIdentifier nid)
196 WithImplicitReconnect
196 WithImplicitReconnect
197 msg
197 msg
198−
src/Control/Distributed/Process/Internal/Primitives.hs+4−4
@@ -126,7 +126,7 @@ import System.Locale (defaultTimeLocale)
126import System.Timeout (timeout)
126import System.Timeout (timeout)
127import Control.Monad (when)
127import Control.Monad (when)
128import Control.Monad.Reader (ask)
128import Control.Monad.Reader (ask)
129−import Control.Monad.IO.Class (MonadIO, liftIO)
129+import Control.Monad.IO.Class (liftIO)
130import Control.Applicative ((<$>))
130import Control.Applicative ((<$>))
131import Control.Exception (Exception(..), throw, throwIO, SomeException)
131import Control.Exception (Exception(..), throw, throwIO, SomeException)
132import qualified Control.Exception as Ex (catch, mask, try)
132import qualified Control.Exception as Ex (catch, mask, try)
@@ -737,10 +737,10 @@ getNodeStats nid = do
737 selfNode <- getSelfNode
737 selfNode <- getSelfNode
738 if nid == selfNode
738 if nid == selfNode
739 then Right `fmap` getLocalNodeStats -- optimisation
739 then Right `fmap` getLocalNodeStats -- optimisation
740− else getNodeStatsRemote nid
740+ else getNodeStatsRemote
741 where
741 where
742− getNodeStatsRemote :: NodeId -> Process (Either DiedReason NodeStats)
742+ getNodeStatsRemote :: Process (Either DiedReason NodeStats)
743− getNodeStatsRemote nid = do
743+ getNodeStatsRemote = do
744 sendCtrlMsg (Just nid) $ GetNodeStats nid
744 sendCtrlMsg (Just nid) $ GetNodeStats nid
745 bracket (monitorNode nid) unmonitor $ \mRef ->
745 bracket (monitorNode nid) unmonitor $ \mRef ->
746 receiveWait [ match (\(stats :: NodeStats) -> return $ Right stats)
746 receiveWait [ match (\(stats :: NodeStats) -> return $ Right stats)
src/Control/Distributed/Process/Management.hs+3−9
@@ -276,8 +276,7 @@ module Control.Distributed.Process.Management
276import Control.Applicative ((<$>))
276import Control.Applicative ((<$>))
277import Control.Concurrent.STM (atomically)
277import Control.Concurrent.STM (atomically)
278import Control.Concurrent.STM.TChan
278import Control.Concurrent.STM.TChan
279− ( tryReadTChan
280− , readTChan
279+ ( readTChan
281 , writeTChan
280 , writeTChan
282 , TChan
281 , TChan
283 )
282 )
@@ -285,7 +284,6 @@ import Control.Distributed.Process.Internal.Primitives
285 ( newChan
284 ( newChan
286 , nsend
285 , nsend
287 , receiveWait
286 , receiveWait
288− , receiveTimeout
289 , matchChan
287 , matchChan
290 , matchAny
288 , matchAny
291 , matchSTM
289 , matchSTM
@@ -320,9 +318,7 @@ import Control.Distributed.Process.Serializable (Serializable)
320import Control.Monad.IO.Class (liftIO)
318import Control.Monad.IO.Class (liftIO)
321import Control.Monad.Reader (ask)
319import Control.Monad.Reader (ask)
322import qualified Control.Monad.State as ST
320import qualified Control.Monad.State as ST
323− ( MonadState
324− , StateT
325− , get
321+ ( get
326 , modify
322 , modify
327 , lift
323 , lift
328 , runStateT
324 , runStateT
@@ -526,8 +522,7 @@ mxAgentWithFinalize mxId initState handlers dtor = do
526-- MxAgentBecome h' -> runAgent h' c state
522-- MxAgentBecome h' -> runAgent h' c state
527
523
528 getNextInput sel chan =
524 getNextInput sel chan =
529− let stmRead = atomically . readTChan
530− matches =
525+ let matches =
531 case sel of
526 case sel of
532 Mailbox -> [ matchAny return
527 Mailbox -> [ matchAny return
533 , matchSTM (readTChan chan) return]
528 , matchSTM (readTChan chan) return]
@@ -554,4 +549,3 @@ mxAgentWithFinalize mxId initState handlers dtor = do
554 case pass of
549 case pass of
555 Nothing -> runPipeline msg state next
550 Nothing -> runPipeline msg state next
556 Just result -> return (result, state')
551 Just result -> return (result, state')
557−
src/Control/Distributed/Process/Node.hs+8−3
@@ -52,7 +52,7 @@ import Data.Foldable (forM_)
52import Data.Maybe (isJust, fromJust, isNothing, catMaybes)
52import Data.Maybe (isJust, fromJust, isNothing, catMaybes)
53import Data.Typeable (Typeable)
53import Data.Typeable (Typeable)
54import Control.Category ((>>>))
54import Control.Category ((>>>))
55−import Control.Applicative ((<$>))
55+import Control.Applicative (Applicative, (<$>))
56import Control.Monad (void, when)
56import Control.Monad (void, when)
57import Control.Monad.IO.Class (MonadIO, liftIO)
57import Control.Monad.IO.Class (MonadIO, liftIO)
58import Control.Monad.State.Strict (MonadState, StateT, evalStateT, gets)
58import Control.Monad.State.Strict (MonadState, StateT, evalStateT, gets)
@@ -99,7 +99,6 @@ import qualified Network.Transport as NT
99 , address
99 , address
100 , closeEndPoint
100 , closeEndPoint
101 , ConnectionId
101 , ConnectionId
102− , Connection
103 , close
102 , close
104 , EndPointAddress
103 , EndPointAddress
105 , Reliability(ReliableOrdered)
104 , Reliability(ReliableOrdered)
@@ -592,7 +591,13 @@ data NCState = NCState
592 }
591 }
593
592
594newtype NC a = NC { unNC :: StateT NCState (ReaderT LocalNode IO) a }
593newtype NC a = NC { unNC :: StateT NCState (ReaderT LocalNode IO) a }
594+ deriving ( Applicative
595+ , Functor
596+ , Monad
597+ , MonadIO
598+ , MonadState NCState
595− deriving (Functor, Monad, MonadIO, MonadState NCState, MonadReader LocalNode)
599+ , MonadReader LocalNode
600+ )
596
601
597initNCState :: NCState
602initNCState :: NCState
598initNCState = NCState { _links = Map.empty
603initNCState = NCState { _links = Map.empty
src/Control/Distributed/Process/UnsafePrimitives.hs+1−2
@@ -70,7 +70,7 @@ import Control.Distributed.Process.Internal.Types
70 )
70 )
71import Control.Distributed.Process.Serializable (Serializable)
71import Control.Distributed.Process.Serializable (Serializable)
72
72
73−import Control.Monad.IO.Class (MonadIO, liftIO)
73+import Control.Monad.IO.Class (liftIO)
74import Control.Monad.Reader (ask)
74import Control.Monad.Reader (ask)
75
75
76-- | Named send to a process in the local registry (asynchronous)
76-- | Named send to a process in the local registry (asynchronous)
@@ -118,4 +118,3 @@ sendChan (SendPort cid) msg = do
118-- | Create an unencoded @Message@ for any @Serializable@ type.
118-- | Create an unencoded @Message@ for any @Serializable@ type.
119wrapMessage :: Serializable a => a -> Message
119wrapMessage :: Serializable a => a -> Message
120wrapMessage = unsafeCreateUnencodedMessage
120wrapMessage = unsafeCreateUnencodedMessage
121−