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

make adjustments for GHC 8 support #4

Merged
merged 1 commit into from
Dec 9, 2016
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
17 changes: 10 additions & 7 deletions distributed-process-client-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: Modelled after Erlang OTP's gen_server, this framework provides
development into a set of modules and standards designed to help you build
concurrent, distributed applications with relative ease.
category: Control
tested-with: GHC == 7.4.2 GHC == 7.6.2
tested-with: GHC == 7.4.2 GHC == 7.6.2 GHC == 8.0.1
data-dir: ""

source-repository head
Expand All @@ -31,16 +31,17 @@ library
distributed-process >= 0.5.2 && < 0.7,
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.5,
binary >= 0.6.3.0 && < 0.9,
deepseq >= 1.3.0.1 && < 1.6,
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.6,
transformers
time > 1.4 && < 1.7,
transformers,
exceptions >= 0.5
if impl(ghc <= 7.5)
Build-Depends: template-haskell == 2.7.0.0,
derive == 2.5.5,
Expand Down Expand Up @@ -85,7 +86,8 @@ test-suite ManagedProcessTests
test-framework-hunit,
transformers,
rematch >= 0.2.0.0,
ghc-prim
ghc-prim,
exceptions >= 0.5
hs-source-dirs:
tests
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
Expand Down Expand Up @@ -117,7 +119,8 @@ test-suite PrioritisedProcessTests
test-framework-hunit,
transformers,
rematch >= 0.2.0.0,
ghc-prim
ghc-prim,
exceptions >= 0.5
hs-source-dirs:
tests
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind
Expand Down
13 changes: 7 additions & 6 deletions src/Control/Distributed/Process/ManagedProcess/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ module Control.Distributed.Process.ManagedProcess.Internal.Types
, waitResponse
) where

import Control.Distributed.Process hiding (Message)
import Control.Distributed.Process hiding (Message, finally)
import Control.Monad.Catch (finally)
import qualified Control.Distributed.Process as P (Message)
import Control.Distributed.Process.Serializable
import Control.Distributed.Process.Extras
Expand Down Expand Up @@ -80,10 +81,11 @@ 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 rnf (CallRef x) = rnf x `seq` ()
--instance Serializable a => Binary (CallRef a) where
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GHC 8 introduces warnings for unnecessary constraints. I should have left this chunk out of the pull request since it is non-essential, but please be aware that the GHC 8 generates a lot of new warnings for this project.

instance Binary (CallRef a) where
instance NFData (CallRef a) where rnf (CallRef x) = rnf x `seq` ()

makeRef :: forall a . (Serializable a) => Recipient -> CallId -> CallRef a
makeRef :: Recipient -> CallId -> CallRef a
makeRef r c = CallRef (r, c)

instance Resolvable (CallRef a) where
Expand Down Expand Up @@ -232,8 +234,7 @@ instance Eq (ControlPort m) where

-- | Obtain an opaque expression for communicating with a 'ControlChannel'.
--
channelControlPort :: (Serializable m)
=> ControlChannel m
channelControlPort :: ControlChannel m
-> ControlPort m
channelControlPort cc = ControlPort $ fst $ unControl cc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ module Control.Distributed.Process.ManagedProcess.Server.Restricted
, say
) where

import Control.Applicative (Applicative)
import Control.Distributed.Process hiding (call, say)
import qualified Control.Distributed.Process as P (say)
import Control.Distributed.Process.Extras
Expand All @@ -73,7 +72,6 @@ import Prelude hiding (init)
import Control.Monad.IO.Class (MonadIO)
import qualified Control.Monad.State as ST
( MonadState
, MonadTrans
, StateT
, get
, lift
Expand Down
1 change: 0 additions & 1 deletion tests/MathsDemo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module MathsDemo
, Add(..)
) where

import Control.Applicative
import Control.Distributed.Process hiding (call)
import Control.Distributed.Process.Extras
import Control.Distributed.Process.Extras.Time
Expand Down
3 changes: 2 additions & 1 deletion tests/TestManagedProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Main where

import Control.Concurrent.MVar
import Control.Exception (SomeException)
import Control.Distributed.Process hiding (call)
import Control.Distributed.Process hiding (call, catch)
import Control.Distributed.Process.Node
import Control.Distributed.Process.Extras hiding (__remoteTable, monitor, send, nsend)
import Control.Distributed.Process.ManagedProcess
Expand All @@ -30,6 +30,7 @@ import ManagedProcessCommon

import qualified Network.Transport as NT
import Control.Monad (void)
import Control.Monad.Catch (catch)

-- utilities

Expand Down
3 changes: 2 additions & 1 deletion tests/TestPrioritisedProcess.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Main where
import Control.Concurrent.MVar
import Control.Exception (SomeException)
import Control.DeepSeq (NFData)
import Control.Distributed.Process hiding (call, send)
import Control.Distributed.Process hiding (call, send, catch)
import Control.Distributed.Process.Node
import Control.Distributed.Process.Extras hiding (__remoteTable)
import Control.Distributed.Process.Async
Expand All @@ -19,6 +19,7 @@ import Control.Distributed.Process.Tests.Internal.Utils
import Control.Distributed.Process.Extras.Time
import Control.Distributed.Process.Extras.Timer
import Control.Distributed.Process.Serializable()
import Control.Monad.Catch (catch)

import Data.Binary
import Data.Either (rights)
Expand Down
1 change: 0 additions & 1 deletion tests/TestUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import Control.Distributed.Process.Node
import Control.Distributed.Process.Extras
import Control.Distributed.Process.Extras.Time
import Control.Distributed.Process.Extras.Timer
import Test.HUnit (Assertion, assertFailure)
import Test.Framework (Test, defaultMain)

import Network.Transport.TCP
Expand Down