Skip to content

Commit aebfe5e

Browse files
authored
Merge pull request #869 from meooow25/doc
Fix some code formatting in docs
2 parents 3db464d + 2467d3b commit aebfe5e

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

containers/src/Data/IntMap/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ differenceWithKey f m1 m2
11291129
-- | \(O(n+m)\). Remove all the keys in a given set from a map.
11301130
--
11311131
-- @
1132-
-- m \`withoutKeys\` s = 'filterWithKey' (\k _ -> k ``IntSet.notMember`` s) m
1132+
-- m \`withoutKeys\` s = 'filterWithKey' (\\k _ -> k ``IntSet.notMember`` s) m
11331133
-- @
11341134
--
11351135
-- @since 0.5.8
@@ -1207,7 +1207,7 @@ intersection m1 m2
12071207
-- | \(O(n+m)\). The restriction of a map to the keys in a set.
12081208
--
12091209
-- @
1210-
-- m \`restrictKeys\` s = 'filterWithKey' (\k _ -> k ``IntSet.member`` s) m
1210+
-- m \`restrictKeys\` s = 'filterWithKey' (\\k _ -> k ``IntSet.member`` s) m
12111211
-- @
12121212
--
12131213
-- @since 0.5.8

containers/src/Data/Map/Internal.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,7 +1899,7 @@ difference t1 (Bin _ k _ l2 r2) = case split k t1 of
18991899
-- | \(O\bigl(m \log\bigl(\frac{n+1}{m+1}\bigr)\bigr), \; m \leq n\). Remove all keys in a 'Set' from a 'Map'.
19001900
--
19011901
-- @
1902-
-- m \`withoutKeys\` s = 'filterWithKey' (\k _ -> k ``Set.notMember`` s) m
1902+
-- m \`withoutKeys\` s = 'filterWithKey' (\\k _ -> k ``Set.notMember`` s) m
19031903
-- m \`withoutKeys\` s = m ``difference`` 'fromSet' (const ()) s
19041904
-- @
19051905
--
@@ -1981,7 +1981,7 @@ intersection t1@(Bin _ k x l1 r1) t2
19811981
-- found in a 'Set'.
19821982
--
19831983
-- @
1984-
-- m \`restrictKeys\` s = 'filterWithKey' (\k _ -> k ``Set.member`` s) m
1984+
-- m \`restrictKeys\` s = 'filterWithKey' (\\k _ -> k ``Set.member`` s) m
19851985
-- m \`restrictKeys\` s = m ``intersection`` 'fromSet' (const ()) s
19861986
-- @
19871987
--
@@ -2467,10 +2467,8 @@ filterMissing f = WhenMissing
24672467
-- | Filter the entries whose keys are missing from the other map
24682468
-- using some 'Applicative' action.
24692469
--
2470-
-- @
2471-
-- filterAMissing f = Merge.Lazy.traverseMaybeMissing $
2472-
-- \k x -> (\b -> guard b *> Just x) <$> f k x
2473-
-- @
2470+
-- > filterAMissing f = Merge.Lazy.traverseMaybeMissing $
2471+
-- > \k x -> (\b -> guard b *> Just x) <$> f k x
24742472
--
24752473
-- but this should be a little faster.
24762474
--
@@ -2899,7 +2897,7 @@ takeWhileAntitone p (Bin _ kx x l r)
28992897
--
29002898
-- @
29012899
-- dropWhileAntitone p = 'fromDistinctAscList' . 'Data.List.dropWhile' (p . fst) . 'toList'
2902-
-- dropWhileAntitone p = 'filterWithKey' (\k -> not (p k))
2900+
-- dropWhileAntitone p = 'filterWithKey' (\\k _ -> not (p k))
29032901
-- @
29042902
--
29052903
-- @since 0.5.8
@@ -2916,7 +2914,7 @@ dropWhileAntitone p (Bin _ kx x l r)
29162914
--
29172915
-- @
29182916
-- spanAntitone p xs = ('takeWhileAntitone' p xs, 'dropWhileAntitone' p xs)
2919-
-- spanAntitone p xs = partitionWithKey (\k _ -> p k) xs
2917+
-- spanAntitone p xs = partitionWithKey (\\k _ -> p k) xs
29202918
-- @
29212919
--
29222920
-- Note: if @p@ is not actually antitone, then @spanAntitone@ will split the map
@@ -3082,7 +3080,7 @@ mapWithKey f (Bin sx kx x l r) = Bin sx kx (f kx x) (mapWithKey f l) (mapWithKey
30823080
#endif
30833081

30843082
-- | \(O(n)\).
3085-
-- @'traverseWithKey' f m == 'fromList' <$> 'traverse' (\(k, v) -> (,) k <$> f k v) ('toList' m)@
3083+
-- @'traverseWithKey' f m == 'fromList' \<$\> 'traverse' (\\(k, v) -> (,) k \<$\> f k v) ('toList' m)@
30863084
-- That is, behaves exactly like a regular 'traverse' except that the traversing
30873085
-- function also has access to the key associated with a value.
30883086
--

containers/src/Data/Map/Strict/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ mapWithKey f (Bin sx kx x l r) =
13851385
#endif
13861386

13871387
-- | \(O(n)\).
1388-
-- @'traverseWithKey' f m == 'fromList' <$> 'traverse' (\(k, v) -> (\v' -> v' \`seq\` (k,v')) <$> f k v) ('toList' m)@
1388+
-- @'traverseWithKey' f m == 'fromList' \<$\> 'traverse' (\\(k, v) -> (\v' -> v' \`seq\` (k,v')) \<$\> f k v) ('toList' m)@
13891389
-- That is, it behaves much like a regular 'traverse' except that the traversing
13901390
-- function also has access to the key associated with a value and the values are
13911391
-- forced before they are installed in the result map.

0 commit comments

Comments
 (0)