on develop help sign in
Improve haddock

- `mplus` -> `mappen` - better coverage

commit0ebc19f624025fe8d232982be7c3f6032e719f65 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateThu 22 Apr 2021, 18:03 (5 years ago) parent4b8916d
3 files changed+10−6
src/Data/Patch/DMapWithMove.hs+2−2 src/Data/Patch/MapWithMove.hs+2−2 src/Data/Patch/MapWithPatchingMove.hs+6−2
src/Data/Patch/DMapWithMove.hs+2−2
@@ -220,8 +220,8 @@ moveDMapKey src dst = case src `geq` dst of
220220-- @
221221-- let aMay = DMap.lookup a dmap
222222-- bMay = DMap.lookup b dmap
223−-- in maybe id (DMap.insert a) (bMay `mplus` aMay)
224−-- . maybe id (DMap.insert b) (aMay `mplus` bMay)
223+-- in maybe id (DMap.insert a) (bMay <> aMay)
224+-- . maybe id (DMap.insert b) (aMay <> bMay)
225225-- . DMap.delete a . DMap.delete b $ dmap
226226-- @
227227swapDMapKey :: GCompare k => k a -> k a -> PatchDMapWithMove k v
src/Data/Patch/MapWithMove.hs+2−2
@@ -156,8 +156,8 @@ moveMapKey src dst = PatchMapWithMove' $ PM.moveMapKey src dst
156156-- @
157157-- let aMay = Map.lookup a map
158158-- bMay = Map.lookup b map
159−-- in maybe id (Map.insert a) (bMay `mplus` aMay)
160−-- . maybe id (Map.insert b) (aMay `mplus` bMay)
159+-- in maybe id (Map.insert a) (bMay <> aMay)
160+-- . maybe id (Map.insert b) (aMay <> bMay)
161161-- . Map.delete a . Map.delete b $ map
162162-- @
163163swapMapKey :: Ord k => k -> k -> PatchMapWithMove k v
src/Data/Patch/MapWithPatchingMove.hs+6−2
@@ -136,8 +136,8 @@ moveMapKey src dst
136136-- @
137137-- let aMay = Map.lookup a map
138138-- bMay = Map.lookup b map
139−-- in maybe id (Map.insert a) (bMay `mplus` aMay)
140−-- . maybe id (Map.insert b) (aMay `mplus` bMay)
139+-- in maybe id (Map.insert a) (bMay <> aMay)
140+-- . maybe id (Map.insert b) (aMay <> bMay)
141141-- . Map.delete a . Map.delete b $ map
142142-- @
143143swapMapKey
@@ -281,6 +281,8 @@ deriving instance (Read k, Read p, Read (PatchTarget p)) => Read (NodeInfo k p)
281281deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (NodeInfo k p)
282282deriving instance (Ord k, Ord p, Ord (PatchTarget p)) => Ord (NodeInfo k p)
283283
284+-- | Traverse the 'NodeInfo' over the key, patch, and patch target. Because of
285+-- the type families here, this doesn't it any bi- or tri-traversal class.
284286bitraverseNodeInfo
285287 :: Applicative f
286288 => (k0 -> f k1)
@@ -322,6 +324,8 @@ deriving instance (Read k, Read p, Read (PatchTarget p)) => Read (From k p)
322324deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (From k p)
323325deriving instance (Ord k, Ord p, Ord (PatchTarget p)) => Ord (From k p)
324326
327+-- | Traverse the 'From' over the key, patch, and patch target. Because of
328+-- the type families here, this doesn't it any bi- or tri-traversal class.
325329bitraverseFrom
326330 :: Applicative f
327331 => (k0 -> f k1)