Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
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
5 changes: 0 additions & 5 deletions distributed-process-async.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ library
stm >= 2.4 && < 2.5,
time > 1.4 && < 1.6,
transformers
if impl(ghc <= 7.5)
Build-Depends: template-haskell == 2.7.0.0,
derive == 2.5.5,
uniplate == 1.6.12,
ghc-prim
extensions: CPP
InstanceSigs
hs-source-dirs: src
Expand Down
5 changes: 1 addition & 4 deletions src/Control/Distributed/Process/Async.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ module Control.Distributed.Process.Async
, waitBoth
) where

#if ! MIN_VERSION_base(4,6,0)
import Prelude hiding (catch)
#endif

import Control.Applicative
import Control.Concurrent.STM hiding (check)
import Control.Distributed.Process
Expand All @@ -74,6 +70,7 @@ import Data.Maybe
)

import System.Timeout (timeout)
import Prelude

-- | Wraps a regular @Process a@ as an 'AsyncTask'.
task :: Process a -> AsyncTask a
Expand Down
10 changes: 8 additions & 2 deletions src/Control/Distributed/Process/Async/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}

-- | shared, internal types for the Async package
module Control.Distributed.Process.Async.Internal.Types
Expand All @@ -23,6 +24,7 @@ import Control.Distributed.Process.Serializable
)
import Data.Binary
import Data.Typeable (Typeable)
import Data.Monoid

import GHC.Generics

Expand All @@ -40,11 +42,14 @@ data Async a = Async {
_asyncWorker :: AsyncRef
, _asyncMonitor :: AsyncRef
, _asyncWait :: STM (AsyncResult a)
}
} deriving (Functor)

instance Eq (Async a) where
Async a b _ == Async c d _ = a == c && b == d

instance Ord (Async a) where
compare (Async a b _) (Async c d _) = a `compare` c <> b `compare` d

-- | A task to be performed asynchronously.
data AsyncTask a =
AsyncTask {
Expand All @@ -67,7 +72,8 @@ data AsyncResult a =
| AsyncLinkFailed DiedReason -- ^ a link failure and the reason
| AsyncCancelled -- ^ a cancelled action
| AsyncPending -- ^ a pending action (that is still running)
deriving (Typeable, Generic)
deriving (Typeable, Generic, Functor)


instance Serializable a => Binary (AsyncResult a) where

Expand Down