@@ -35,49 +35,35 @@ module RON.Data.RGA
3535 )
3636where
3737
38- import Data.Algorithm.Diff (Diff (Both , First , Second ), getGroupedDiffBy )
38+ import Data.Algorithm.Diff (Diff (Both , First , Second ),
39+ getGroupedDiffBy )
40+ import Data.Bifunctor (second )
3941import qualified Data.HashMap.Strict as HashMap
40- import Data.Map.Strict ((!?) )
42+ import Data.Map.Strict ((!?) )
4143import qualified Data.Map.Strict as Map
4244import qualified Data.Text as Text
43- import RON.Data.Internal
44- ( MonadObjectState ,
45- ReducedChunk (ReducedChunk , rcBody , rcRef ),
46- Reducible ,
47- Rep ,
48- Replicated (encoding ),
49- ReplicatedAsObject ,
50- ReplicatedAsPayload ,
51- Unapplied ,
52- applyPatches ,
53- fromRon ,
54- getObjectStateChunk ,
55- modifyObjectStateChunk_ ,
56- newObject ,
57- newRon ,
58- objectEncoding ,
59- readObject ,
60- reduceUnappliedPatches ,
61- reducibleOpType ,
62- stateFromChunk ,
63- stateToChunk ,
64- toPayload ,
65- )
66- import RON.Error (MonadE , errorContext , throwErrorText )
67- import RON.Event (ReplicaClock , getEventUuid , getEventUuids )
68- import RON.Prelude
69- import RON.Semilattice (Semilattice )
70- import RON.Types
71- ( ObjectRef (ObjectRef ),
72- Op (Op , opId , payload , refId ),
73- StateChunk (StateChunk ),
74- StateFrame ,
75- UUID ,
76- WireStateChunk (WireStateChunk , stateBody , stateType ),
77- )
78- import RON.UUID (uuidVersion , pattern Zero )
45+
46+ import RON.Data.Internal (MonadObjectState ,
47+ ReducedChunk (ReducedChunk , rcBody , rcRef ),
48+ Reducible , Rep , Replicated (encoding ),
49+ ReplicatedAsObject , ReplicatedAsPayload ,
50+ Unapplied , applyPatches , fromRon ,
51+ getObjectStateChunk ,
52+ modifyObjectStateChunk_ , newObject , newRon ,
53+ objectEncoding , readObject ,
54+ reduceUnappliedPatches , reducibleOpType ,
55+ stateFromChunk , stateToChunk , toPayload )
56+ import RON.Error (MonadE , errorContext , throwErrorText )
57+ import RON.Event (ReplicaClock , getEventUuid , getEventUuids )
58+ import RON.Prelude
59+ import RON.Semilattice (Semilattice )
60+ import RON.Types (ObjectRef (ObjectRef ),
61+ Op (Op , opId , payload , refId ),
62+ StateChunk (StateChunk ), StateFrame , UUID ,
63+ WireStateChunk (WireStateChunk , stateBody , stateType ))
64+ import RON.Util.Word (pattern B11 , ls60 )
65+ import RON.UUID (pattern Zero , uuidVersion )
7966import qualified RON.UUID as UUID
80- import RON.Util.Word (ls60 , pattern B11 )
8167
8268{-# ANN module ("HLint: ignore Reduce duplication" :: String) #-}
8369
@@ -201,7 +187,7 @@ instance Reducible RgaRep where
201187 stateToChunk (RgaRep rga) = maybe [] vertexListToOps rga
202188
203189 applyPatches rga (patches, ops) =
204- bimap id patchSetToChunks . reapplyPatchSetToState rga
190+ second patchSetToChunks . reapplyPatchSetToState rga
205191 $ foldMap patchSetFromChunk patches <> foldMap patchSetFromRawOp ops
206192
207193 reduceUnappliedPatches (patches, ops) =
0 commit comments