packages feed

crdt 6.1 → 6.2

raw patch · 2 files changed

+10/−7 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ CRDT.LamportClock: instance CRDT.LamportClock.Clock m => CRDT.LamportClock.Clock (Control.Monad.Trans.Reader.ReaderT r m)
+ CRDT.LamportClock: instance CRDT.LamportClock.Process m => CRDT.LamportClock.Process (Control.Monad.Trans.Reader.ReaderT r m)

Files

crdt.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 23bb86a0781bcb24463115698ce7fa54478558dc1e341c509ce2db3b2f5a71d7+-- hash: 7021f3e0d6e0f14ccbff42fd8252b25b479ffd645160458d77d1c854912c9698  name:           crdt-version:        6.1+version:        6.2 synopsis:       Conflict-free replicated data types description:    Definitions of CmRDT and CvRDT. Implementations for some classic CRDTs. category:       Distributed Systems
lib/CRDT/LamportClock.hs view
@@ -33,7 +33,6 @@ import           Data.Time.Clock.POSIX (getPOSIXTime) import           Data.Word (Word64) import           Network.Info (MAC (MAC), getNetworkInterfaces, mac)-import           Numeric (showHex) import           Numeric.Natural (Natural) import           Safe (headDef) @@ -41,10 +40,7 @@ type LocalTime = Natural  data LamportTime = LamportTime !LocalTime !Pid-    deriving (Eq, Ord)--instance Show LamportTime where-    show (LamportTime time (Pid pid)) = showHex time "" ++ '-' : showHex pid ""+    deriving (Eq, Ord, Show)  -- | Unique process identifier newtype Pid = Pid Word64@@ -134,3 +130,10 @@                 pure time1             pid <- getPidByMac             pure $ LamportTime time1 pid++instance Process m => Process (ReaderT r m) where+    getPid = lift getPid++instance Clock m => Clock (ReaderT r m) where+    advance = lift . advance+    getTime = lift getTime