@@ -48,6 +48,13 @@ patchMapWithMove m = if valid then Just $ PatchMapWithMove m else Nothing
4848 From_Move from -> Just (from, to)
4949 _ -> Nothing
5050
51+-- | Create a 'PatchMapWithMove' that inserts everything in the given 'Map'
52+patchMapWithMoveInsertAll :: Map k v -> PatchMapWithMove k v
53+patchMapWithMoveInsertAll m = PatchMapWithMove $ flip fmap m $ \v -> NodeInfo
54+ { _nodeInfo_from = From_Insert v
55+ , _nodeInfo_to = Nothing
56+ }
57+
5158-- | Extract the internal representation of the 'PatchMapWithMove'
5259unPatchMapWithMove :: PatchMapWithMove k v -> Map k (NodeInfo k v)
5360unPatchMapWithMove (PatchMapWithMove p) = p