@@ -73,13 +73,13 @@ instance {-# INCOHERENT #-} (GEq k, EqTag k v) => EqTag k (From k v) where
7373-- |Structure describing a particular change to a key, be it inserting a new key (@From_Insert@), updating an existing key (@From_Insert@ again), deleting a
7474-- key (@From_Delete@), or moving a key (@From_Move@).
7575data From (k :: a -> *) (v :: a -> *) :: a -> * where
76+ -- |Insert a new or update an existing key with the given value @v a@
7677 From_Insert :: v a -> From k v a
77− -- ^Insert a new or update an existing key with the given value @v a@
78+ -- |Delete the existing key
7879 From_Delete :: From k v a
79− -- ^Delete the existing key
80− From_Move :: !(k a) -> From k v a
81− -- ^Move the value from the given key @k a@ to this key. The source key should also have an entry in the patch giving the current key as @_nodeInfo_to@,
80+ -- |Move the value from the given key @k a@ to this key. The source key should also have an entry in the patch giving the current key as @_nodeInfo_to@,
8281 -- usually but not necessarily with @From_Delete@.
82+ From_Move :: !(k a) -> From k v a
8383 deriving (Show, Read, Eq, Ord)
8484
8585-- |Type alias for the "to" part of a 'NodeInfo'. @'ComposeMaybe' ('Just' k)@ means the key is moving to another key, @ComposeMaybe Nothing@ for any other
@@ -93,7 +93,7 @@ validPatchDMapWithMove = not . null . validationErrorsForPatchDMapWithMove
9393-- |Enumerate what reasons a 'PatchDMapWithMove' doesn't satisfy its invariants, returning @[]@ if it's valid.
9494validationErrorsForPatchDMapWithMove :: forall k v. (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> [String]
9595validationErrorsForPatchDMapWithMove m =
96− noSelfMoves `mappend` movesBalanced
96+ noSelfMoves <> movesBalanced
9797 where
9898 noSelfMoves = catMaybes . map selfMove . DMap.toAscList $ m
9999 selfMove (dst :=> NodeInfo (From_Move src) _) | Just _ <- dst `geq` src = Just $ "self move of key " <> gshow src <> " at destination side"