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

Add compatibility with ghc-7.10 #1

Merged
merged 2 commits into from
Jun 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions distributed-process-client-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ library
distributed-process-extras >= 0.2.0 && < 0.3,
distributed-process-async >= 0.2.1 && < 0.3,
binary >= 0.6.3.0 && < 0.8,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
mtl,
containers >= 0.4 && < 0.6,
hashable >= 1.2.0.5 && < 1.3,
unordered-containers >= 0.2.3.0 && < 0.3,
fingertree < 0.2,
stm >= 2.4 && < 2.5,
time > 1.4 && < 1.5,
time > 1.4 && < 1.6,
transformers
if impl(ghc <= 7.5)
Build-Depends: template-haskell == 2.7.0.0,
Expand Down Expand Up @@ -81,7 +81,7 @@ test-suite ManagedProcessTests
fingertree < 0.2,
network-transport-tcp >= 0.4 && < 0.5,
binary >= 0.6.3.0 && < 0.8,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
network >= 2.3 && < 2.7,
HUnit >= 1.2 && < 2,
stm >= 2.3 && < 2.5,
Expand Down Expand Up @@ -113,7 +113,7 @@ test-suite PrioritisedProcessTests
fingertree < 0.2,
network-transport-tcp >= 0.4 && < 0.5,
binary >= 0.6.3.0 && < 0.8,
deepseq >= 1.3.0.1 && < 1.4,
deepseq >= 1.3.0.1 && < 1.5,
network >= 2.3 && < 2.7,
HUnit >= 1.2 && < 2,
stm >= 2.3 && < 2.5,
Expand Down
10 changes: 7 additions & 3 deletions src/Control/Distributed/Process/ManagedProcess/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import Control.Distributed.Process.Extras.Internal.Types
( resolveOrDie
)
import Control.Distributed.Process.Extras.Time
import Control.DeepSeq (NFData)
import Control.DeepSeq (NFData(..))
import Data.Binary hiding (decode)
import Data.Typeable (Typeable)

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

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

instance (Serializable a, Serializable b) => Binary (Message a b) where
instance (NFSerializable a, NFSerializable b) => NFData (Message a b) where
rnf (CastMessage a) = rnf a `seq` ()
rnf (CallMessage a b) = rnf a `seq` rnf b `seq` ()
rnf (ChanMessage a b) = rnf a `seq` rnf b `seq` ()
deriving instance (Eq a, Eq b) => Eq (Message a b)
deriving instance (Show a, Show b) => Show (Message a b)

data CallResponse a = CallResponse a CallId
deriving (Typeable, Generic)

instance Serializable a => Binary (CallResponse a)
instance NFSerializable a => NFData (CallResponse a)
instance NFSerializable a => NFData (CallResponse a) where
rnf (CallResponse a c) = rnf a `seq` rnf c `seq` ()
deriving instance Eq a => Eq (CallResponse a)
deriving instance Show a => Show (CallResponse a)

Expand Down
2 changes: 1 addition & 1 deletion tests/TestUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ mkNode port = do
testMain :: (NT.Transport -> IO [Test]) -> IO ()
testMain builder = do
Right (transport, _) <- createTransportExposeInternals
"127.0.0.1" "10501" defaultTCPParameters
"127.0.0.1" "0" defaultTCPParameters
testData <- builder transport
defaultMain testData