From b2049f2458741e788099f78b42aad8dff47d99f8 Mon Sep 17 00:00:00 2001 From: David Simmons-Duffin Date: Sun, 7 Nov 2021 21:53:07 -0800 Subject: [PATCH 1/3] Turn Serializable into a type synonym. Squash warnings in 8.10.7. --- .../Control/Distributed/Process/Tests/CH.hs | 26 +++----- .../Distributed/Process/Tests/Closure.hs | 5 +- .../Distributed/Process/Tests/Receive.hs | 60 +++++++++---------- .../Distributed/Process/Internal/CQueue.hs | 2 - .../Process/Internal/Closure/TH.hs | 1 - .../Process/Internal/StrictMVar.hs | 15 ----- .../Process/Management/Internal/Types.hs | 1 - src/Control/Distributed/Process/Node.hs | 6 -- .../Distributed/Process/Serializable.hs | 4 +- 9 files changed, 42 insertions(+), 78 deletions(-) diff --git a/distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs b/distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs index c9cd8f24..59a23141 100644 --- a/distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs +++ b/distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs @@ -42,9 +42,7 @@ import Control.Distributed.Process.Internal.Types , createUnencodedMessage ) import Control.Distributed.Process.Node -import Control.Distributed.Process.Debug -import Control.Distributed.Process.Management.Internal.Types -import Control.Distributed.Process.Tests.Internal.Utils (shouldBe, pause) +import Control.Distributed.Process.Tests.Internal.Utils (pause) import Control.Distributed.Process.Serializable (Serializable) import Data.Maybe (isNothing, isJust) import Test.HUnit (Assertion, assertBool, assertFailure) @@ -102,14 +100,6 @@ whereisRemote nid string = do verifyWhereIsRemote :: NodeId -> String -> Process ProcessId verifyWhereIsRemote n s = whereisRemote n s >>= maybe (die "remote name not found") return -waitForExit :: ProcessId -> Process DiedReason -waitForExit pid = monitor pid >>= waitForDown - -waitForDown :: MonitorRef -> Process DiedReason -waitForDown ref = - receiveWait [ matchIf (\(ProcessMonitorNotification ref' _ _) -> ref == ref') - (\(ProcessMonitorNotification _ _ dr) -> return dr) ] - syncBreakConnection :: (NT.EndPointAddress -> NT.EndPointAddress -> IO ()) -> LocalNode -> LocalNode -> IO () syncBreakConnection breakConnection nid0 nid1 = do m <- newEmptyMVar @@ -706,9 +696,9 @@ testRegistry TestTransport{..} = do checkRegException name pid dead = try (register name dead) >>= checkReg name pid - checkReg name pid res = + checkReg _ _ res = case res of - Left (ProcessRegistrationException name pid) -> return () + Left (ProcessRegistrationException _ _) -> return () _ -> die $ "Unexpected Registration" ++ show res testRegistryRemoteProcess :: TestTransport -> Assertion @@ -759,7 +749,7 @@ testRemoteRegistry TestTransport{..} = do -- test that if process was not registered Nothing is returned -- in owner field. registerRemoteAsync nid1 "dead" deadProcess - receiveWait [ matchIf (\(RegisterReply label' f mPid) -> "dead" == label') + receiveWait [ matchIf (\(RegisterReply label' _ _) -> "dead" == label') (\(RegisterReply _ f mPid) -> return (not f && isNothing mPid)) ] >>= liftIO . assertBool "Expected False Nothing in RegisterReply" @@ -1296,7 +1286,7 @@ testChanLifecycle TestTransport{..} = let delay = 3000000 in do res <- receiveChanTimeout delay rp case res of Nothing -> say "initial chan () missing!" >> (liftIO $ putMVar result False) - Just () -> do mr <- monitor pid + Just () -> do _ <- monitor pid pause 10000 -- say "sending pid a second () will cause it to exit" send pid () @@ -1571,7 +1561,7 @@ testRegistryMonitoring TestTransport{..} = do res <- whereis regName send pid () say $ " sent finish signal to " ++ show pid - us <- getSelfPid + _ <- getSelfPid liftIO $ assertBool "expected (Just pid)" $ res == (Just pid) @@ -1600,7 +1590,7 @@ testRegistryMonitoring TestTransport{..} = do res <- takeMVar regHere case res of Nothing -> return () - Just pid -> assertBool ("expected Nothing, but got " ++ show pid) False + _ -> assertBool ("expected Nothing, but got " ++ show pid) False where runUntilRegistered nid us = do @@ -1613,7 +1603,7 @@ testRegistryMonitoring TestTransport{..} = do delayUntilMaybeUnregistered nid p = do whereisRemoteAsync nid regName res <- receiveTimeout 20000000 {- 20 sec delay -} [ - matchIf (\(WhereIsReply n p) -> n == regName && isNothing p) + matchIf (\(WhereIsReply n p') -> n == regName && isNothing p') (const $ return ()) ] case res of diff --git a/distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs b/distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs index 55c8ead8..f3f7dda1 100644 --- a/distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs +++ b/distributed-process-tests/src/Control/Distributed/Process/Tests/Closure.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-unused-top-binds #-} {-# LANGUAGE TemplateHaskell, KindSignatures #-} module Control.Distributed.Process.Tests.Closure (tests) where @@ -19,14 +20,12 @@ import Control.Concurrent.MVar , modifyMVar_ , newMVar ) -import Control.Applicative ((<$>)) import System.Random (randomIO) import Control.Distributed.Process import Control.Distributed.Process.Closure import Control.Distributed.Process.Node import Control.Distributed.Process.Internal.Types - ( NodeId(nodeAddress) - , createMessage + ( createMessage , messageToPayload ) import Control.Distributed.Static (staticLabel, staticClosure) diff --git a/distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs b/distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs index d06ecff7..b58a1438 100644 --- a/distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs +++ b/distributed-process-tests/src/Control/Distributed/Process/Tests/Receive.hs @@ -101,44 +101,44 @@ master = do kill p "BANG" liftIO $ putStrLn "\n---- Test 2 ----" - (s1,r1) <- newChan - (s2,r2) <- newChan - p <- spawnLocal (recTest2 waitr syncs r1 r2) - - sendChan s1 "a" >> go "received1 a" - send p "foo" >> go "received2 foo" - sendChan s1 "a" >> send p "foo" >> go "received1 a" - sendChan s1 "a" >> send p "bar" >> go "received1 a" + (s1',r1') <- newChan + (_ ,r2') <- newChan + p' <- spawnLocal (recTest2 waitr syncs r1' r2') + + sendChan s1' "a" >> go "received1 a" + send p' "foo" >> go "received2 foo" + sendChan s1' "a" >> send p "foo" >> go "received1 a" + sendChan s1' "a" >> send p "bar" >> go "received1 a" go "received2 foo" - kill p "BANG" + kill p' "BANG" liftIO $ putStrLn "\n---- Test 3 ----" - (s1,r1) <- newChan - (s2,r2) <- newChan - p <- spawnLocal (recTest3 waitr syncs r1 r2) - - sendChan s1 "a" >> go "received2 a" - send p "foo" >> go "received1 foo" - sendChan s1 "a" >> send p "foo" >> go "received1 foo" - sendChan s1 "a" >> send p "bar" >> go "received2 a" + (s1'',r1'') <- newChan + (_ ,r2'') <- newChan + p'' <- spawnLocal (recTest3 waitr syncs r1'' r2'') + + sendChan s1'' "a" >> go "received2 a" + send p'' "foo" >> go "received1 foo" + sendChan s1'' "a" >> send p "foo" >> go "received1 foo" + sendChan s1'' "a" >> send p "bar" >> go "received2 a" go "received2 a" - kill p "BANG" + kill p'' "BANG" liftIO $ putStrLn "\n---- Test 4 ----" - (s1,r1) <- newChan - (s2,r2) <- newChan - p <- spawnLocal (recTest4 waitr syncs r1 r2) - - sendChan s1 "a" >> go "received2 a" - send p "foo" >> go "received1 foo" - send p "bar" >> go "received3 bar" - sendChan s1 "a" >> send p "foo" >> go "received1 foo" - send p "bar" >> go "received2 a" - send p "foo" >> go "received1 foo" >> go "received3 bar" - - kill p "BANG" + (s1''',r1''') <- newChan + (_ ,r2''') <- newChan + p''' <- spawnLocal (recTest4 waitr syncs r1''' r2''') + + sendChan s1''' "a" >> go "received2 a" + send p''' "foo" >> go "received1 foo" + send p''' "bar" >> go "received3 bar" + sendChan s1''' "a" >> send p''' "foo" >> go "received1 foo" + send p''' "bar" >> go "received2 a" + send p''' "foo" >> go "received1 foo" >> go "received3 bar" + + kill p''' "BANG" terminate diff --git a/src/Control/Distributed/Process/Internal/CQueue.hs b/src/Control/Distributed/Process/Internal/CQueue.hs index 4fb43dd7..889e1ff5 100644 --- a/src/Control/Distributed/Process/Internal/CQueue.hs +++ b/src/Control/Distributed/Process/Internal/CQueue.hs @@ -31,7 +31,6 @@ import Control.Concurrent.STM , orElse , retry ) -import Control.Applicative ((<$>), (<*>)) import Control.Exception (mask_, onException) import System.Timeout (timeout) import Control.Distributed.Process.Internal.StrictMVar @@ -45,7 +44,6 @@ import Control.Distributed.Process.Internal.StrictList , append ) import Data.Maybe (fromJust) -import Data.Traversable (traverse) import GHC.MVar (MVar(MVar)) import GHC.IO (IO(IO), unIO) import GHC.Exts (mkWeak#) diff --git a/src/Control/Distributed/Process/Internal/Closure/TH.hs b/src/Control/Distributed/Process/Internal/Closure/TH.hs index 21e780ea..ecc38d4f 100644 --- a/src/Control/Distributed/Process/Internal/Closure/TH.hs +++ b/src/Control/Distributed/Process/Internal/Closure/TH.hs @@ -12,7 +12,6 @@ module Control.Distributed.Process.Internal.Closure.TH ) where import Prelude hiding (succ, any) -import Control.Applicative ((<$>)) import Language.Haskell.TH ( -- Q monad and operations Q diff --git a/src/Control/Distributed/Process/Internal/StrictMVar.hs b/src/Control/Distributed/Process/Internal/StrictMVar.hs index a9fd3102..00be882a 100644 --- a/src/Control/Distributed/Process/Internal/StrictMVar.hs +++ b/src/Control/Distributed/Process/Internal/StrictMVar.hs @@ -14,13 +14,8 @@ module Control.Distributed.Process.Internal.StrictMVar , mkWeakMVar ) where -import Control.Applicative ((<$>)) import Control.Monad ((>=>)) -#if MIN_VERSION_base(4,6,0) -import Control.Exception (evaluate) -#else import Control.Exception (evaluate, mask_, onException) -#endif import qualified Control.Concurrent.MVar as MVar ( MVar , newEmptyMVar @@ -31,9 +26,6 @@ import qualified Control.Concurrent.MVar as MVar , withMVar , modifyMVar_ , modifyMVar -#if MIN_VERSION_base(4,6,0) - , modifyMVarMasked -#endif ) import GHC.MVar (MVar(MVar)) import GHC.IO (IO(IO), unIO) @@ -71,18 +63,11 @@ modifyMVar (StrictMVar v) f = MVar.modifyMVar v (f >=> evaluateFst) modifyMVarMasked :: StrictMVar a -> (a -> IO (a, b)) -> IO b modifyMVarMasked (StrictMVar v) f = -#if MIN_VERSION_base(4,6,0) - MVar.modifyMVarMasked v (f >=> evaluateFst) -#else mask_ $ do a <- MVar.takeMVar v (a',b) <- (f a >>= evaluate) `onException` MVar.putMVar v a MVar.putMVar v a' return b -#endif - where - evaluateFst :: (a, b) -> IO (a, b) - evaluateFst (x, y) = evaluate x >> return (x, y) mkWeakMVar :: StrictMVar a -> IO () -> IO (Weak (StrictMVar a)) mkWeakMVar q@(StrictMVar (MVar m#)) f = IO $ \s -> diff --git a/src/Control/Distributed/Process/Management/Internal/Types.hs b/src/Control/Distributed/Process/Management/Internal/Types.hs index d8c42f4f..acf06147 100644 --- a/src/Control/Distributed/Process/Management/Internal/Types.hs +++ b/src/Control/Distributed/Process/Management/Internal/Types.hs @@ -14,7 +14,6 @@ module Control.Distributed.Process.Management.Internal.Types , Addressable(..) ) where -import Control.Applicative (Applicative) import Control.Concurrent.STM ( TChan ) diff --git a/src/Control/Distributed/Process/Node.hs b/src/Control/Distributed/Process/Node.hs index 2cea19b2..b46c508f 100644 --- a/src/Control/Distributed/Process/Node.hs +++ b/src/Control/Distributed/Process/Node.hs @@ -28,11 +28,8 @@ import Data.Binary (decode) import Data.Map (Map) import qualified Data.Map as Map ( empty - , delete , toList , fromList - , insert - , lookup , partition , partitionWithKey , elems @@ -213,9 +210,6 @@ import Control.Distributed.Process.Internal.Primitives , match , sendChan , unwrapMessage - , monitor - , unmonitorAsync - , getSelfNode , SayMessage(..) ) import Control.Distributed.Process.Internal.Types (SendPort, Tracer(..)) diff --git a/src/Control/Distributed/Process/Serializable.hs b/src/Control/Distributed/Process/Serializable.hs index dd80d433..4ca80437 100644 --- a/src/Control/Distributed/Process/Serializable.hs +++ b/src/Control/Distributed/Process/Serializable.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -40,8 +41,7 @@ data TypeableDict a where deriving (Typeable) -- | Objects that can be sent across the network -class (Binary a, Typeable a) => Serializable a -instance (Binary a, Typeable a) => Serializable a +type Serializable a = (Binary a, Typeable a) -- | Encode type representation as a bytestring encodeFingerprint :: Fingerprint -> ByteString From 8bc784534f5dbf097706ef7a45194f166f1c6159 Mon Sep 17 00:00:00 2001 From: David Simmons-Duffin Date: Mon, 8 Nov 2021 09:47:06 -0800 Subject: [PATCH 2/3] Drop 7.10, bump base version to 4.9 --- .github/workflows/distributed-process-ci.yml | 3 +-- .../distributed-process-tests.cabal | 16 ++++++++-------- distributed-process.cabal | 12 ++++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/distributed-process-ci.yml b/.github/workflows/distributed-process-ci.yml index 5ec29c40..d6e85659 100644 --- a/.github/workflows/distributed-process-ci.yml +++ b/.github/workflows/distributed-process-ci.yml @@ -6,8 +6,7 @@ jobs: strategy: matrix: ghcVersion: - [ "7.10.3" - , "8.2.2" + [ "8.2.2" , "8.4.4" , "8.6.5" , "8.8.4" diff --git a/distributed-process-tests/distributed-process-tests.cabal b/distributed-process-tests/distributed-process-tests.cabal index 3c937bc5..a6ddba22 100644 --- a/distributed-process-tests/distributed-process-tests.cabal +++ b/distributed-process-tests/distributed-process-tests.cabal @@ -25,7 +25,7 @@ library Control.Distributed.Process.Tests.Stats Control.Distributed.Process.Tests.Tracing Control.Distributed.Process.Tests.Internal.Utils - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, ansi-terminal >= 0.5, binary >= 0.5 && < 0.9, bytestring >= 0.9 && < 0.12, @@ -59,7 +59,7 @@ Test-Suite TestCHInMemory Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.CH - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -74,7 +74,7 @@ Test-Suite TestCHInTCP Main-Is: runTCP.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.CH if flag(tcp) - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.5 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -91,7 +91,7 @@ Test-Suite TestClosure Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.Closure - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -105,7 +105,7 @@ Test-Suite TestStats Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.Stats - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -119,7 +119,7 @@ Test-Suite TestMxInMemory Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.Mx - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -133,7 +133,7 @@ Test-Suite TestTracingInMemory Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.Tracing - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, @@ -147,7 +147,7 @@ Test-Suite TestMxInTCP Type: exitcode-stdio-1.0 Main-Is: runInMemory.hs CPP-Options: -DTEST_SUITE_MODULE=Control.Distributed.Process.Tests.Mx - Build-Depends: base >= 4.4 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process-tests, network >= 2.3 && < 3.2, network-transport >= 0.4.1.0 && < 0.6, diff --git a/distributed-process.cabal b/distributed-process.cabal index 0fa69a61..def67cec 100644 --- a/distributed-process.cabal +++ b/distributed-process.cabal @@ -41,7 +41,7 @@ flag old-locale default: False Library - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, binary >= 0.6.3 && < 0.10, hashable >= 1.2.0.5 && < 1.4, network-transport >= 0.4.1.0 && < 0.6, @@ -119,7 +119,7 @@ Library benchmark distributed-process-throughput Type: exitcode-stdio-1.0 - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process, network-transport-tcp >= 0.3 && < 0.7, bytestring >= 0.9 && < 0.11, @@ -129,7 +129,7 @@ benchmark distributed-process-throughput benchmark distributed-process-latency Type: exitcode-stdio-1.0 - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process, network-transport-tcp >= 0.3 && < 0.7, bytestring >= 0.9 && < 0.11, @@ -139,7 +139,7 @@ benchmark distributed-process-latency benchmark distributed-process-channels Type: exitcode-stdio-1.0 - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process, network-transport-tcp >= 0.3 && < 0.7, bytestring >= 0.9 && < 0.11, @@ -149,7 +149,7 @@ benchmark distributed-process-channels benchmark distributed-process-spawns Type: exitcode-stdio-1.0 - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process, network-transport-tcp >= 0.3 && < 0.7, bytestring >= 0.9 && < 0.11, @@ -159,7 +159,7 @@ benchmark distributed-process-spawns benchmark distributed-process-ring Type: exitcode-stdio-1.0 - Build-Depends: base >= 4.6 && < 5, + Build-Depends: base >= 4.9 && < 5, distributed-process, network-transport-tcp >= 0.3 && < 0.7, bytestring >= 0.9 && < 0.11, From 61939a4864894e4354b69295588c1b83ed55f10c Mon Sep 17 00:00:00 2001 From: David Simmons-Duffin Date: Mon, 1 May 2023 21:53:47 -0700 Subject: [PATCH 3/3] Fix some more warnings in 9.4 --- distributed-process-tests/distributed-process-tests.cabal | 8 ++++---- .../Distributed/Process/Internal/Closure/Explicit.hs | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/distributed-process-tests/distributed-process-tests.cabal b/distributed-process-tests/distributed-process-tests.cabal index a6ddba22..82dbc30f 100644 --- a/distributed-process-tests/distributed-process-tests.cabal +++ b/distributed-process-tests/distributed-process-tests.cabal @@ -66,7 +66,7 @@ Test-Suite TestCHInMemory network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP - ghc-options: -Wall -threaded -eventlog -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind + ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests Test-Suite TestCHInTCP @@ -83,7 +83,7 @@ Test-Suite TestCHInTCP else Buildable: False Extensions: CPP - ghc-options: -Wall -threaded -eventlog -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind + ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests @@ -112,7 +112,7 @@ Test-Suite TestStats network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP - ghc-options: -Wall -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind + ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests Test-Suite TestMxInMemory @@ -140,7 +140,7 @@ Test-Suite TestTracingInMemory network-transport-inmemory >= 0.5, test-framework >= 0.6 && < 0.9 Extensions: CPP - ghc-options: -eventlog -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind + ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-warn-unused-do-bind HS-Source-Dirs: tests Test-Suite TestMxInTCP diff --git a/src/Control/Distributed/Process/Internal/Closure/Explicit.hs b/src/Control/Distributed/Process/Internal/Closure/Explicit.hs index 40065fb9..4a7ae88a 100644 --- a/src/Control/Distributed/Process/Internal/Closure/Explicit.hs +++ b/src/Control/Distributed/Process/Internal/Closure/Explicit.hs @@ -7,6 +7,7 @@ , KindSignatures , GADTs , EmptyDataDecls + , TypeOperators , DeriveDataTypeable #-} module Control.Distributed.Process.Internal.Closure.Explicit ( @@ -29,6 +30,7 @@ import Data.Rank1Dynamic import Data.Rank1Typeable import Data.Binary(encode,put,get,Binary) import qualified Data.ByteString.Lazy as B +import Data.Kind (Type) -- | A RemoteRegister is a trasformer on a RemoteTable to register additional static values. type RemoteRegister = RemoteTable -> RemoteTable @@ -118,7 +120,7 @@ instance Curry (b -> c) r => Curry ((a,b) -> c) (a -> r) where -- This generic uncurry courtesy Andrea Vezzosi data HTrue data HFalse -data Fun :: * -> * -> * -> * where +data Fun :: Type -> Type -> Type -> Type where Done :: Fun EndOfTuple r r Moar :: Fun xs f r -> Fun (x,xs) (x -> f) r