Skip to content

Commit 0ebc19f

Browse files
committed
Improve haddock
- `mplus` -> `mappen` - better coverage
1 parent 4b8916d commit 0ebc19f

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/Data/Patch/DMapWithMove.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
-- @
227227
swapDMapKey :: GCompare k => k a -> k a -> PatchDMapWithMove k v

src/Data/Patch/MapWithMove.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
-- @
163163
swapMapKey :: Ord k => k -> k -> PatchMapWithMove k v

src/Data/Patch/MapWithPatchingMove.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
-- @
143143
swapMapKey
@@ -281,6 +281,8 @@ deriving instance (Read k, Read p, Read (PatchTarget p)) => Read (NodeInfo k p)
281281
deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (NodeInfo k p)
282282
deriving 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.
284286
bitraverseNodeInfo
285287
:: Applicative f
286288
=> (k0 -> f k1)
@@ -322,6 +324,8 @@ deriving instance (Read k, Read p, Read (PatchTarget p)) => Read (From k p)
322324
deriving instance (Eq k, Eq p, Eq (PatchTarget p)) => Eq (From k p)
323325
deriving 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.
325329
bitraverseFrom
326330
:: Applicative f
327331
=> (k0 -> f k1)

0 commit comments

Comments
 (0)