Skip to content

Commit bd37cca

Browse files
authored
Merge pull request #467 from tmcgilchrist/cleanup
General tidy up of dependencies and warnings
2 parents 66fae14 + e3196db commit bd37cca

File tree

20 files changed

+21
-76
lines changed

20 files changed

+21
-76
lines changed

.github/workflows/cabal.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: Continuous integration
22

33
on:
44
push:
5+
branches: ['master']
56
paths-ignore:
67
- 'README.md'
78
- 'CONTRIBUTING.md'
89
pull_request:
10+
branches: ['master']
911

1012
jobs:
1113
continuous-integration:

packages/distributed-process-async/distributed-process-async.cabal

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,10 @@ library
3838
import: warnings
3939
build-depends:
4040
base >= 4.14 && < 5,
41-
data-accessor >= 0.2.2.3,
4241
distributed-process >= 0.6.1 && < 0.8,
4342
exceptions >= 0.10 && < 1.0,
4443
binary >= 0.8 && < 0.9,
45-
deepseq >= 1.4 && < 1.7,
46-
mtl,
47-
containers >= 0.6 && < 0.8,
48-
hashable >= 1.2.0.5 && < 1.6,
49-
unordered-containers >= 0.2.3.0 && < 0.3,
50-
fingertree < 0.2,
5144
stm >= 2.4 && < 2.6,
52-
time >= 1.9,
53-
transformers
5445
default-extensions: CPP
5546
InstanceSigs
5647
hs-source-dirs: src
@@ -66,20 +57,14 @@ test-suite AsyncTests
6657
x-uses-tf: true
6758
build-depends:
6859
base >= 4.14 && < 5,
69-
ansi-terminal >= 0.5 && < 1.2,
7060
distributed-process,
7161
distributed-process-async,
7262
distributed-process-systest ^>= 0.4,
73-
exceptions >= 0.10 && < 1.0,
74-
network >= 2.5 && < 3.3,
7563
network-transport >= 0.4 && < 0.6,
7664
network-transport-tcp >= 0.6 && < 0.9,
7765
binary >= 0.8 && < 0.9,
78-
deepseq >= 1.4 && < 1.7,
79-
stm >= 2.3 && < 2.6,
8066
tasty >= 1.5 && <1.6,
8167
tasty-hunit >=0.10 && <0.11,
82-
transformers
8368
hs-source-dirs: tests
8469
default-language: Haskell2010
8570
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind

packages/distributed-process-client-server/distributed-process-client-server.cabal

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,8 @@ library
4646
deepseq >= 1.4 && < 1.7,
4747
mtl,
4848
containers >= 0.6 && < 0.8,
49-
hashable >= 1.2.0.5 && < 1.6,
50-
unordered-containers >= 0.2.3.0 && < 0.3,
5149
fingertree < 0.2,
5250
stm >= 2.4 && < 2.6,
53-
time > 1.4 && < 1.15,
54-
transformers,
5551
exceptions >= 0.10 && < 0.11
5652
hs-source-dirs: src
5753
exposed-modules:
@@ -74,25 +70,17 @@ test-suite ManagedProcessTests
7470
x-uses-tf: true
7571
build-depends:
7672
base >= 4.14 && < 5,
77-
ansi-terminal >= 0.5 && < 1.2,
78-
containers,
7973
distributed-process,
8074
distributed-process-extras,
8175
distributed-process-async,
8276
distributed-process-client-server,
8377
distributed-process-systest ^>= 0.4,
8478
network-transport >= 0.4 && < 0.7,
85-
mtl,
86-
fingertree,
8779
network-transport-tcp >= 0.6 && < 0.9,
8880
binary >= 0.8 && < 0.9,
89-
deepseq,
90-
network >= 2.3 && < 3.3,
9181
stm,
9282
tasty >= 1.5 && <1.6,
9383
tasty-hunit >=0.10 && <0.11,
94-
transformers,
95-
ghc-prim,
9684
exceptions
9785
other-modules: Counter,
9886
ManagedProcessCommon,
@@ -111,25 +99,18 @@ test-suite PrioritisedProcessTests
11199
x-uses-tf: true
112100
build-depends:
113101
base >= 4.14 && < 5,
114-
ansi-terminal,
115-
containers,
116102
distributed-process,
117103
distributed-process-extras,
118104
distributed-process-async,
119105
distributed-process-client-server,
120106
distributed-process-systest ^>= 0.4,
121107
network-transport,
122-
mtl,
123-
fingertree,
124108
network-transport-tcp,
125109
binary,
126110
deepseq,
127-
network,
128111
stm,
129112
tasty >= 1.5 && <1.6,
130113
tasty-hunit >=0.10 && <0.11,
131-
transformers,
132-
ghc-prim,
133114
exceptions
134115
other-modules: ManagedProcessCommon,
135116
TestUtils

packages/distributed-process-client-server/src/Control/Distributed/Process/ManagedProcess.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,6 @@ module Control.Distributed.Process.ManagedProcess
651651
import Control.Distributed.Process hiding (call, Message)
652652
import Control.Distributed.Process.ManagedProcess.Client
653653
import Control.Distributed.Process.ManagedProcess.Server
654-
import qualified Control.Distributed.Process.ManagedProcess.Server.Restricted as R
655654
import qualified Control.Distributed.Process.ManagedProcess.Server.Priority as P hiding (reject)
656655
import qualified Control.Distributed.Process.ManagedProcess.Internal.GenProcess as Gen
657656
import Control.Distributed.Process.ManagedProcess.Internal.GenProcess

packages/distributed-process-client-server/src/Control/Distributed/Process/ManagedProcess/Server/Gen.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ import qualified Control.Distributed.Process.ManagedProcess.Internal.GenProcess
9797
, modifyState
9898
, setUserTimeout
9999
, setProcessState
100-
, GenProcess
101100
, peek
102101
, push
103102
, enqueue

packages/distributed-process-client-server/src/Control/Distributed/Process/ManagedProcess/Timer.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import Control.Distributed.Process.Extras.Timer
6767
import Data.Binary (Binary)
6868
import Data.Maybe (isJust, fromJust)
6969
import Data.Typeable (Typeable)
70-
import GHC.Conc (registerDelay)
7170
import GHC.Generics
7271

7372
--------------------------------------------------------------------------------

packages/distributed-process-extras/src/Control/Distributed/Process/Extras/Internal/Containers/MultiMap.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ module Control.Distributed.Process.Extras.Internal.Containers.MultiMap
2121

2222
import qualified Data.Foldable as Foldable
2323
import Data.Foldable (Foldable)
24-
2524
import Data.Hashable
2625
import Data.HashMap.Strict (HashMap)
2726
import qualified Data.HashMap.Strict as Map
2827
import Data.HashSet (HashSet)
2928
import qualified Data.HashSet as Set
30-
import Data.Foldable (Foldable(foldr))
3129
import Prelude hiding (lookup, filter, pred)
3230

3331
-- | Class of things that can be inserted in a map or

packages/distributed-process-extras/tests/TestQueues.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import qualified Control.Distributed.Process.Extras.Internal.Queue.PriorityQ as
99
import Data.Function (on)
1010
import Data.List ( sortBy )
1111
import Test.Tasty (TestTree, testGroup, defaultMain)
12-
import Test.Tasty.HUnit (Assertion, assertEqual, assertBool, testCase)
12+
import Test.Tasty.HUnit (assertEqual, assertBool, testCase)
1313
import Test.Tasty.QuickCheck (testProperty)
1414

1515
import Prelude

packages/distributed-process-extras/tests/TestTimer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Control.Distributed.Process.Extras.Timer
1919
import Control.Distributed.Process.SysTest.Utils
2020

2121
import Test.Tasty (TestTree, testGroup, defaultMain)
22-
import Test.Tasty.HUnit (Assertion, assertEqual, assertBool, testCase)
22+
import Test.Tasty.HUnit (testCase)
2323
import Network.Transport.TCP
2424
import qualified Network.Transport as NT
2525

packages/distributed-process-simplelocalnet/distributed-process-simplelocalnet.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ Library
4545
data-accessor >= 0.2 && < 0.3,
4646
binary >= 0.8 && < 0.9,
4747
containers >= 0.6 && < 0.8,
48-
transformers >= 0.2 && < 0.7,
4948
network-transport >= 0.5 && < 0.6,
5049
network-transport-tcp >= 0.4 && < 0.9,
5150
distributed-process >= 0.5.0 && < 0.8

packages/distributed-process-simplelocalnet/tests/Main.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
import Control.Concurrent (forkIO, threadDelay)
44
import qualified Control.Concurrent.MVar as MVar
5-
import Control.Distributed.Process (NodeId, Process, liftIO)
65
import Control.Distributed.Process.Node (initRemoteTable)
76
import Control.Distributed.Process.Backend.SimpleLocalnet
87
import Control.Monad (forM_)
8+
import Control.Monad.IO.Class (liftIO)
99
import qualified Data.List as List
1010
import Test.Tasty (TestTree, defaultMain, testGroup)
1111
import Test.Tasty.HUnit (assertEqual, testCase)
1212

1313
main :: IO ()
14-
main = defaultMain
15-
$ testGroup "Test suite"
14+
main = defaultMain
15+
$ testGroup "Test suite"
1616
[ testDiscoverNodes
1717
]
1818

@@ -24,7 +24,7 @@ testDiscoverNodes = testCase "discover nodes" $ do
2424
backend <- initializeBackend "127.0.0.1" port initRemoteTable
2525
_ <- forkIO $ startSlave backend
2626
threadDelay 100000
27-
27+
2828
-- initialize master node
2929
discoveredNodesSlot <- MVar.newEmptyMVar
3030
backend <- initializeBackend "127.0.0.1" "10004" initRemoteTable
@@ -33,12 +33,12 @@ testDiscoverNodes = testCase "discover nodes" $ do
3333
liftIO $ MVar.putMVar discoveredNodesSlot nds
3434

3535
discoveredNodes <- (List.sort . List.nub) <$> MVar.readMVar discoveredNodesSlot
36-
assertEqual "Discovered nodes"
36+
assertEqual "Discovered nodes"
3737
[ "nid://127.0.0.1:10000:0"
3838
, "nid://127.0.0.1:10001:0"
3939
, "nid://127.0.0.1:10002:0"
4040
, "nid://127.0.0.1:10003:0"
41-
]
41+
]
4242
(map show discoveredNodes)
4343

4444

packages/distributed-process-supervisor/src/Control/Distributed/Process/Supervisor/Management.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import Control.Distributed.Process.Supervisor.Types
5252
, SupervisorPid
5353
)
5454
import Data.Binary
55-
import Data.Foldable (mapM_)
5655
import Data.Hashable (Hashable(..))
5756
import Control.Distributed.Process.Extras.Internal.Containers.MultiMap (MultiMap)
5857
import qualified Control.Distributed.Process.Extras.Internal.Containers.MultiMap as Map

packages/distributed-process/distributed-process.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ Library
5252
hashable >= 1.2.0.5 && < 1.6,
5353
network-transport >= 0.4.1.0 && < 0.6,
5454
stm >= 2.4 && < 2.6,
55-
transformers >= 0.2 && < 0.7,
5655
mtl >= 2.0 && < 2.4,
5756
data-accessor >= 0.2 && < 0.3,
5857
bytestring >= 0.10 && < 0.13,

packages/network-transport-inmemory/tests/TestInMemory.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Network.Transport.Tests
44
import Network.Transport.Tests.Auxiliary (runTests)
55
import Network.Transport.InMemory
66
import Network.Transport
7-
import Control.Applicative ((<$>))
87

98
main :: IO ()
109
main = do

packages/network-transport-tcp/src/Network/Transport/TCP.hs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import Network.Transport.Internal
7171
( prependLength
7272
, mapIOException
7373
, tryIO
74-
, tryToEnum
7574
, void
7675
, timeoutMaybe
7776
, asyncWhenCancelled
@@ -130,7 +129,6 @@ import Control.Concurrent.MVar
130129
)
131130
import Control.Concurrent.Async (async, wait)
132131
import Control.Category ((>>>))
133-
import Control.Applicative ((<$>))
134132
import Control.Monad (when, unless, join, mplus, (<=<))
135133
import Control.Exception
136134
( IOException
@@ -151,10 +149,10 @@ import Control.Exception
151149
)
152150
import Data.IORef (IORef, newIORef, writeIORef, readIORef, writeIORef)
153151
import Data.ByteString (ByteString)
154-
import qualified Data.ByteString as BS (concat, length, null)
152+
import qualified Data.ByteString as BS (concat, null)
155153
import qualified Data.ByteString.Char8 as BSC (pack, unpack)
156154
import Data.Bits (shiftL, (.|.))
157-
import Data.Maybe (isJust, isNothing, fromJust)
155+
import Data.Maybe (isJust, isNothing)
158156
import Data.Word (Word32)
159157
import Data.Set (Set)
160158
import qualified Data.Set as Set
@@ -168,7 +166,6 @@ import qualified Data.Set as Set
168166
)
169167
import Data.Map (Map)
170168
import qualified Data.Map as Map (empty)
171-
import Data.Traversable (traverse)
172169
import Data.Accessor (Accessor, accessor, (^.), (^=), (^:))
173170
import qualified Data.Accessor.Container as DAC (mapMaybe)
174171
import Data.Foldable (forM_, mapM_)
@@ -821,8 +818,6 @@ apiConnect transport ourEndPoint theirAddress _reliability hints =
821818
{ send = apiSend (ourEndPoint, theirEndPoint) connId connAlive
822819
, close = apiClose (ourEndPoint, theirEndPoint) connId connAlive
823820
}
824-
where
825-
params = transportParams transport
826821

827822
-- | Close a connection
828823
apiClose :: EndPointPair -> LightweightConnectionId -> IORef Bool -> IO ()
@@ -1025,7 +1020,7 @@ handleConnectionRequest transport socketClosed (sock, sockAddr) = handle handleE
10251020
handleConnectionRequestV0 :: (N.Socket, N.SockAddr) -> IO (Maybe (IO ()))
10261021
handleConnectionRequestV0 (sock, sockAddr) = do
10271022
-- Get the OS-determined host and port.
1028-
(numericHost, resolvedHost, actualPort) <-
1023+
(numericHost, resolvedHost, _actualPort) <-
10291024
resolveSockAddr sockAddr >>=
10301025
maybe (throwIO (userError "handleConnectionRequest: invalid socket address")) return
10311026
-- The peer must send our identifier and their address promptly, if a
@@ -1304,7 +1299,7 @@ handleIncomingMessages params (ourEndPoint, theirEndPoint) =
13041299

13051300
-- Close the socket (if we don't have any outgoing connections)
13061301
closeSocket :: N.Socket -> LightweightConnectionId -> IO Bool
1307-
closeSocket sock lastReceivedId = do
1302+
closeSocket _sock lastReceivedId = do
13081303
mAct <- modifyMVar theirState $ \st -> do
13091304
case st of
13101305
RemoteEndPointInvalid _ ->
@@ -1388,8 +1383,8 @@ handleIncomingMessages params (ourEndPoint, theirEndPoint) =
13881383
"handleIncomingMessages:closeSocket (closed)"
13891384
case mAct of
13901385
Nothing -> return False
1391-
Just act -> do
1392-
runScheduledAction (ourEndPoint, theirEndPoint) act
1386+
Just act' -> do
1387+
runScheduledAction (ourEndPoint, theirEndPoint) act'
13931388
return True
13941389

13951390
-- Read a message and output it on the endPoint's channel. By rights we
@@ -2013,7 +2008,7 @@ schedule theirEndPoint act = do
20132008
-- However, it will then wait until @p@ is executed (by this call to
20142009
-- 'runScheduledAction' or by another).
20152010
runScheduledAction :: EndPointPair -> Action a -> IO a
2016-
runScheduledAction (ourEndPoint, theirEndPoint) mvar = do
2011+
runScheduledAction (_ourEndPoint, theirEndPoint) mvar = do
20172012
join $ readChan (remoteScheduled theirEndPoint)
20182013
ma <- readMVar mvar
20192014
case ma of

packages/network-transport-tcp/tests/TestTCP.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ import Control.Concurrent.MVar ( MVar
2727
, putMVar
2828
, takeMVar
2929
, readMVar
30-
, isEmptyMVar
3130
, newMVar
3231
, modifyMVar
3332
, modifyMVar_
34-
, swapMVar
3533
)
36-
import Control.Monad (replicateM, guard, forM_, replicateM_, when)
37-
import Control.Applicative ((<$>))
34+
import Control.Monad (replicateM, guard, replicateM_, when)
3835
import Control.Exception (throwIO, try, SomeException)
3936
import Network.Transport.TCP ( socketToEndPoint )
4037
import Network.Transport.Internal ( prependLength
@@ -48,7 +45,6 @@ import Network.Transport.TCP.Internal
4845
, decodeControlHeader
4946
, ConnectionRequestResponse(..)
5047
, encodeConnectionRequestResponse
51-
, decodeConnectionRequestResponse
5248
, encodeWord32
5349
, recvWord32
5450
, forkServer
@@ -63,12 +59,10 @@ import qualified Network.Transport.TCP.Mock.Socket as N
6359
import qualified Network.Socket as N
6460
#endif
6561
( close
66-
, ServiceName
6762
, Socket
6863
, AddrInfo
6964
, shutdown
7065
, ShutdownCmd(ShutdownSend)
71-
, SockAddr(..)
7266
, SocketType(Stream)
7367
, AddrInfo(..)
7468
, getAddrInfo

packages/network-transport-tests/src/Network/Transport/Tests.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Control.Exception
2020
)
2121
import Control.Monad (replicateM, replicateM_, when, guard, forM_, unless)
2222
import Control.Monad.Except ()
23-
import Control.Applicative ((<$>))
2423
import Network.Transport
2524
import Network.Transport.Internal (tlog, tryIO, timeoutMaybe)
2625
import Network.Transport.Util (spawn)
@@ -652,7 +651,7 @@ testCloseEndPoint transport _ = do
652651

653652
-- First test (see client)
654653
do
655-
theirAddr <- readMVar clientAddr1
654+
_theirAddr <- readMVar clientAddr1
656655
ConnectionOpened cid ReliableOrdered addr <- receive endpoint
657656
-- Ensure that connecting to the supplied address reaches the peer.
658657
Right conn <- connect endpoint addr ReliableOrdered defaultConnectHints
@@ -716,7 +715,7 @@ testCloseEndPoint transport _ = do
716715
send conn ["ping"]
717716

718717
-- Reply from the server
719-
ConnectionOpened cid ReliableOrdered addr <- receive endpoint
718+
ConnectionOpened cid ReliableOrdered _addr <- receive endpoint
720719
Received cid' ["pong"] <- receive endpoint ; True <- return $ cid == cid'
721720

722721
-- Close the endpoint

0 commit comments

Comments
 (0)