Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 2cc3f29

Browse files
Merge pull request #1 from qnikst/ghc-7.10
Add compatibility with ghc-7.10
2 parents d335dec + 68d810e commit 2cc3f29

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Control/Distributed/Process/ManagedProcess/Internal/Types.hs

+7-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import Control.Distributed.Process.Extras.Internal.Types
6464
( resolveOrDie
6565
)
6666
import Control.Distributed.Process.Extras.Time
67-
import Control.DeepSeq (NFData)
67+
import Control.DeepSeq (NFData(..))
6868
import Data.Binary hiding (decode)
6969
import Data.Typeable (Typeable)
7070

@@ -81,7 +81,7 @@ type CallId = MonitorRef
8181
newtype CallRef a = CallRef { unCaller :: (Recipient, CallId) }
8282
deriving (Eq, Show, Typeable, Generic)
8383
instance Serializable a => Binary (CallRef a) where
84-
instance NFData a => NFData (CallRef a) where
84+
instance NFData a => NFData (CallRef a) where rnf (CallRef x) = rnf x `seq` ()
8585

8686
makeRef :: forall a . (Serializable a) => Recipient -> CallId -> CallRef a
8787
makeRef r c = CallRef (r, c)
@@ -101,14 +101,18 @@ data Message a b =
101101

102102
instance (Serializable a, Serializable b) => Binary (Message a b) where
103103
instance (NFSerializable a, NFSerializable b) => NFData (Message a b) where
104+
rnf (CastMessage a) = rnf a `seq` ()
105+
rnf (CallMessage a b) = rnf a `seq` rnf b `seq` ()
106+
rnf (ChanMessage a b) = rnf a `seq` rnf b `seq` ()
104107
deriving instance (Eq a, Eq b) => Eq (Message a b)
105108
deriving instance (Show a, Show b) => Show (Message a b)
106109

107110
data CallResponse a = CallResponse a CallId
108111
deriving (Typeable, Generic)
109112

110113
instance Serializable a => Binary (CallResponse a)
111-
instance NFSerializable a => NFData (CallResponse a)
114+
instance NFSerializable a => NFData (CallResponse a) where
115+
rnf (CallResponse a c) = rnf a `seq` rnf c `seq` ()
112116
deriving instance Eq a => Eq (CallResponse a)
113117
deriving instance Show a => Show (CallResponse a)
114118

tests/TestUtils.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ mkNode port = do
4545
testMain :: (NT.Transport -> IO [Test]) -> IO ()
4646
testMain builder = do
4747
Right (transport, _) <- createTransportExposeInternals
48-
"127.0.0.1" "10501" defaultTCPParameters
48+
"127.0.0.1" "0" defaultTCPParameters
4949
testData <- builder transport
5050
defaultMain testData

0 commit comments

Comments
 (0)