distributed-process-extras 0.3.9 → 0.3.10
raw patch · 3 files changed
+22/−20 lines, 3 filesdep ~timePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: time
API changes (from Hackage documentation)
- Control.Distributed.Process.Extras: killProc :: (Killable p, Resolvable p) => p -> String -> Process ()
+ Control.Distributed.Process.Extras: killProc :: Killable p => p -> String -> Process ()
- Control.Distributed.Process.Extras: linkTo :: (Linkable a, Resolvable a) => a -> Process ()
+ Control.Distributed.Process.Extras: linkTo :: Linkable a => a -> Process ()
- Control.Distributed.Process.Extras: unresolvableMessage :: (Resolvable a, Resolvable a) => a -> String
+ Control.Distributed.Process.Extras: unresolvableMessage :: Resolvable a => a -> String
- Control.Distributed.Process.Extras.Call: multicall :: forall a b. (Serializable a, Serializable b) => [ProcessId] -> a -> Tag -> Timeout -> Process [Maybe b]
+ Control.Distributed.Process.Extras.Call: multicall :: (Serializable a, Serializable b) => [ProcessId] -> a -> Tag -> Timeout -> Process [Maybe b]
- Control.Distributed.Process.Extras.Internal.Containers.MultiMap: filter :: forall k v. Insertable k => (v -> Bool) -> MultiMap k v -> MultiMap k v
+ Control.Distributed.Process.Extras.Internal.Containers.MultiMap: filter :: Insertable k => (v -> Bool) -> MultiMap k v -> MultiMap k v
- Control.Distributed.Process.Extras.Internal.Containers.MultiMap: filterWithKey :: forall k v. Insertable k => (k -> v -> Bool) -> MultiMap k v -> MultiMap k v
+ Control.Distributed.Process.Extras.Internal.Containers.MultiMap: filterWithKey :: Insertable k => (k -> v -> Bool) -> MultiMap k v -> MultiMap k v
- Control.Distributed.Process.Extras.Internal.Containers.MultiMap: insert :: forall k v. (Insertable k, Insertable v) => k -> v -> MultiMap k v -> MultiMap k v
+ Control.Distributed.Process.Extras.Internal.Containers.MultiMap: insert :: (Insertable k, Insertable v) => k -> v -> MultiMap k v -> MultiMap k v
- Control.Distributed.Process.Extras.Internal.Primitives: killProc :: (Killable p, Resolvable p) => p -> String -> Process ()
+ Control.Distributed.Process.Extras.Internal.Primitives: killProc :: Killable p => p -> String -> Process ()
- Control.Distributed.Process.Extras.Internal.Primitives: linkTo :: (Linkable a, Resolvable a) => a -> Process ()
+ Control.Distributed.Process.Extras.Internal.Primitives: linkTo :: Linkable a => a -> Process ()
- Control.Distributed.Process.Extras.Internal.Primitives: unresolvableMessage :: (Resolvable a, Resolvable a) => a -> String
+ Control.Distributed.Process.Extras.Internal.Primitives: unresolvableMessage :: Resolvable a => a -> String
- Control.Distributed.Process.Extras.Internal.Types: killProc :: (Killable p, Resolvable p) => p -> String -> Process ()
+ Control.Distributed.Process.Extras.Internal.Types: killProc :: Killable p => p -> String -> Process ()
- Control.Distributed.Process.Extras.Internal.Types: linkTo :: (Linkable a, Resolvable a) => a -> Process ()
+ Control.Distributed.Process.Extras.Internal.Types: linkTo :: Linkable a => a -> Process ()
- Control.Distributed.Process.Extras.Internal.Types: unresolvableMessage :: (Resolvable a, Resolvable a) => a -> String
+ Control.Distributed.Process.Extras.Internal.Types: unresolvableMessage :: Resolvable a => a -> String
- Control.Distributed.Process.Extras.Internal.Unsafe: newInputStream :: forall a. Typeable a => Either (ReceivePort a) (STM a) -> InputStream a
+ Control.Distributed.Process.Extras.Internal.Unsafe: newInputStream :: Typeable a => Either (ReceivePort a) (STM a) -> InputStream a
- Control.Distributed.Process.Extras.SystemLog: toLog :: (ToLog m, Serializable m) => m -> Process (LogLevel -> LogMessage)
+ Control.Distributed.Process.Extras.SystemLog: toLog :: ToLog m => m -> Process (LogLevel -> LogMessage)
Files
- ChangeLog +5/−0
- distributed-process-extras.cabal +4/−4
- src/Control/Distributed/Process/Extras/Time.hs +13/−16
ChangeLog view
@@ -1,3 +1,8 @@+2026-10-22 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.3.10 ++* Added support for `time-1.15` and `time-1.16`.+* Added support for `containers-0.8`.+ 2025-02-04 Laurent P. René de Cotret <laurent.decotret@outlook.com> 0.3.9 * Ported test suite to use `tasty` rather than `test-framework`.
distributed-process-extras.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: distributed-process-extras-version: 0.3.9+version: 0.3.10 build-type: Simple license: BSD-3-Clause license-file: LICENCE@@ -14,7 +14,7 @@ description: Supporting library, providing common types and utilities used by the various libraries built on top of distributed-process category: Control-tested-with: GHC==8.10.7 GHC==9.0.2 GHC==9.2.8 GHC==9.4.5 GHC==9.6.4 GHC==9.8.2 GHC==9.10.1 GHC==9.12.1+tested-with: GHC==8.10.7 GHC==9.0.2 GHC==9.2.8 GHC==9.4.8 GHC==9.6.7 GHC==9.8.4 GHC==9.10.3 GHC==9.12.2 GHC==9.14.1 extra-doc-files: ChangeLog source-repository head@@ -39,13 +39,13 @@ distributed-process >= 0.6.0 && < 0.8, binary >= 0.8 && < 0.9, deepseq >= 1.4 && < 1.7,- containers >= 0.6 && < 0.8,+ containers >= 0.6 && < 0.9, exceptions >= 0.10, hashable >= 1.2.0.5 && < 1.6, unordered-containers >= 0.2.3.0 && < 0.3, fingertree < 0.2, stm >= 2.4 && < 2.6,- time >= 1.5+ time >= 1.5 && < 1.17 other-extensions: ExistentialQuantification HS-Source-Dirs: src exposed-modules:
src/Control/Distributed/Process/Extras/Time.hs view
@@ -1,4 +1,3 @@-{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} -----------------------------------------------------------------------------@@ -58,8 +57,7 @@ import Control.Monad (void) import Data.Binary import Data.Ratio ((%))-import Data.Time.Clock-import Data.Typeable (Typeable)+import Data.Time.Clock ( NominalDiffTime ) import GHC.Generics @@ -69,14 +67,14 @@ -- | Defines the time unit for a Timeout value data TimeUnit = Days | Hours | Minutes | Seconds | Millis | Micros- deriving (Typeable, Generic, Eq, Show)+ deriving (Generic, Eq, Show) instance Binary TimeUnit where instance NFData TimeUnit where -- | A time interval. data TimeInterval = TimeInterval TimeUnit Int- deriving (Typeable, Generic, Eq, Show)+ deriving (Generic, Eq, Show) instance Binary TimeInterval where instance NFData TimeInterval where@@ -84,7 +82,7 @@ -- | Represents either a delay of 'TimeInterval', an infinite wait or no delay -- (i.e., non-blocking). data Delay = Delay TimeInterval | Infinity | NoDelay- deriving (Typeable, Generic, Eq, Show)+ deriving (Generic, Eq, Show) instance Binary Delay where instance NFData Delay where@@ -95,10 +93,9 @@ -- | Send to a process when a timeout expires. data TimeoutNotification = TimeoutNotification Tag- deriving (Typeable) instance Binary TimeoutNotification where- get = fmap TimeoutNotification $ get+ get = fmap TimeoutNotification get put (TimeoutNotification n) = put n -- time interval/unit handling@@ -198,13 +195,13 @@ -- | given a @NominalDiffTim@@, provide an equivalent @TimeInterval@ diffTimeToTimeInterval :: NominalDiffTime -> TimeInterval-diffTimeToTimeInterval dt = microSeconds $ (fromIntegral (round (dt * 1000000) :: Integer))+diffTimeToTimeInterval dt = microSeconds (fromIntegral (round (dt * 1000000) :: Integer)) -- | given a @Delay@, provide an equivalent @NominalDiffTim@ delayToDiffTime :: Delay -> NominalDiffTime delayToDiffTime (Delay ti) = timeIntervalToDiffTime ti delayToDiffTime Infinity = error "trying to convert Delay.Infinity to a NominalDiffTime"-delayToDiffTime (NoDelay) = microsecondsToNominalDiffTime 0+delayToDiffTime NoDelay = microsecondsToNominalDiffTime 0 -- | given a @NominalDiffTim@@, provide an equivalent @Delay@ diffTimeToDelay :: NominalDiffTime -> Delay@@ -212,7 +209,7 @@ -- | Create a 'NominalDiffTime' from a number of microseconds. microsecondsToNominalDiffTime :: Integer -> NominalDiffTime-microsecondsToNominalDiffTime x = fromRational (x % (fromIntegral microSecondsPerSecond))+microsecondsToNominalDiffTime x = fromRational (x % fromIntegral microSecondsPerSecond) -- tenYearsAsMicroSeconds :: Integer -- tenYearsAsMicroSeconds = 10 * 365 * 24 * 60 * 60 * 1000000@@ -223,10 +220,10 @@ t1 - t2 = microSeconds $ asTimeout t1 - asTimeout t2 _ * _ = error "trying to multiply two TimeIntervals" abs t = microSeconds $ abs (asTimeout t)- signum t = if (asTimeout t) == 0- then 0- else if (asTimeout t) < 0 then -1- else 1+ signum t+ | asTimeout t == 0 = 0+ | asTimeout t < 0 = -1+ | otherwise = 1 fromInteger _ = error "trying to call fromInteger for a TimeInterval. Cannot guess units" -- | Allow @(+)@ and @(-)@ operations on @Delay@s@@ -249,7 +246,7 @@ abs Infinity = Infinity abs (Delay t) = Delay (abs t) - signum (NoDelay) = 0+ signum NoDelay = 0 signum Infinity = 1 signum (Delay t) = Delay (signum t)