@@ -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
100 , closeEndPoint
100 , closeEndPoint
101 , ConnectionId
101 , ConnectionId
104 , EndPointAddress
103 , EndPointAddress
105 , Reliability(ReliableOrdered)
104 , Reliability(ReliableOrdered)
@@ -592,7 +591,13 @@ data NCState = NCState
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
598+ , MonadState NCState
595− deriving (Functor, Monad, MonadIO, MonadState NCState, MonadReader LocalNode)
599+ , MonadReader LocalNode
597initNCState :: NCState
602initNCState :: NCState
598initNCState = NCState { _links = Map.empty
603initNCState = NCState { _links = Map.empty