crjdt-haskell 0.2.0.0 → 0.2.1
raw patch · 4 files changed
+12/−7 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Crjdt: sync :: (ReplicaId, Command ()) -> (ReplicaId, Command ()) -> Either EvalError (Eval (), Eval ())
+ Data.Crjdt: sync :: (ReplicaId, Command a) -> (ReplicaId, Command b) -> Either EvalError (Eval a, Eval b)
Files
- CHANGELOG.md +6/−2
- README.md +0/−1
- crjdt-haskell.cabal +1/−1
- src/Data/Crjdt.hs +5/−3
CHANGELOG.md view
@@ -1,7 +1,11 @@-0.0.2+0.2.1 +* Generalize helper function sync++0.2.0+ * BREAKING CHANGE: helper function sync is not IO anymore -0.0.1+0.1.0 * Initial release
README.md view
@@ -13,7 +13,6 @@ ```haskell {-# LANGUAGE OverloadedStrings #-}- module Main where import Data.Crjdt as C
crjdt-haskell.cabal view
@@ -1,5 +1,5 @@ name: crjdt-haskell-version: 0.2.0.0+version: 0.2.1 synopsis: A Conflict-Free Replicated JSON Datatype for Haskell description: A Conflict-Free Replicated JSON Datatype for Haskell homepage: https://github.com/amarpotghan/crjdt-haskell#readme
src/Data/Crjdt.hs view
@@ -47,7 +47,9 @@ import Data.Set (Set) import Data.Void import Data.Function+import Data.Bifunctor (bimap) import Control.Monad.Free (liftF)+import Control.Applicative (liftA2) import Data.Crjdt.Context as Core import Data.Crjdt.Types as Core@@ -146,7 +148,7 @@ ----------------------------------------------------------------------------------------------- -- Utility functions -sync :: (ReplicaId, Command ()) -> (ReplicaId, Command ()) -> Either EvalError (Eval (), Eval ())+sync :: (ReplicaId, Command a) -> (ReplicaId, Command b) -> Either EvalError (Eval a, Eval b) sync (rid1, first) (rid2, second) = let (rFirst, sFirst) = run rid1 (Eval.execute first) (rSecond, sSecond) = run rid2 (Eval.execute second)@@ -154,6 +156,6 @@ Eval.execute which addReceivedOps (queue replica) Eval.execute yield- in case (rFirst *> rSecond) of- Right () -> pure $ (synced first sSecond, synced second sFirst)+ in case (liftA2 (,) rFirst rSecond) of+ Right (a, b) -> pure $ bimap (a <$) (b <$) (synced first sSecond, synced second sFirst) Left ex -> Left ex