on develop help sign in
fix haddock failure in PatchDMapWithMove
1b36922Ross MacLeod
src/Reflex/Patch/DMapWithMove.hs+5−5
@@ -73,13 +73,13 @@ instance {-# INCOHERENT #-} (GEq k, EqTag k v) => EqTag k (From k v) where
73-- |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
73-- |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
74-- key (@From_Delete@), or moving a key (@From_Move@).
74-- key (@From_Delete@), or moving a key (@From_Move@).
75data From (k :: a -> *) (v :: a -> *) :: a -> * where
75data From (k :: a -> *) (v :: a -> *) :: a -> * where
76+ -- |Insert a new or update an existing key with the given value @v a@
76 From_Insert :: v a -> From k v a
77 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
78 From_Delete :: From k v a
79 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@,
82 -- usually but not necessarily with @From_Delete@.
81 -- usually but not necessarily with @From_Delete@.
82+ From_Move :: !(k a) -> From k v a
83 deriving (Show, Read, Eq, Ord)
83 deriving (Show, Read, Eq, Ord)
84
84
85-- |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
85-- |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
93-- |Enumerate what reasons a 'PatchDMapWithMove' doesn't satisfy its invariants, returning @[]@ if it's valid.
93-- |Enumerate what reasons a 'PatchDMapWithMove' doesn't satisfy its invariants, returning @[]@ if it's valid.
94validationErrorsForPatchDMapWithMove :: forall k v. (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> [String]
94validationErrorsForPatchDMapWithMove :: forall k v. (GCompare k, GEq k, GShow k) => DMap k (NodeInfo k v) -> [String]
95validationErrorsForPatchDMapWithMove m =
95validationErrorsForPatchDMapWithMove m =
96− noSelfMoves `mappend` movesBalanced
96+ noSelfMoves <> movesBalanced
97 where
97 where
98 noSelfMoves = catMaybes . map selfMove . DMap.toAscList $ m
98 noSelfMoves = catMaybes . map selfMove . DMap.toAscList $ m
99 selfMove (dst :=> NodeInfo (From_Move src) _) | Just _ <- dst `geq` src = Just $ "self move of key " <> gshow src <> " at destination side"
99 selfMove (dst :=> NodeInfo (From_Move src) _) | Just _ <- dst `geq` src = Just $ "self move of key " <> gshow src <> " at destination side"