Skip to content

Commit 6b070fc

Browse files
harpocratesm-renaud
authored andcommitted
Haddock fixes (#560)
Tweaked documentation fixing Haddock markup. Mostly: * qualifying out-of-scope or ambiguous identifiers * properly escaping character literals in examples * several obvious typos
1 parent 58ca823 commit 6b070fc

File tree

16 files changed

+64
-63
lines changed

16 files changed

+64
-63
lines changed

Data/Graph.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ graphFromEdges' x = (a,b) where
412412
-- > (graph, nodeFromVertex, vertexFromKey) = graphFromEdges []
413413
-- > graph = array (0,-1) []
414414
--
415-
-- A graph where the out-list references unspecified nodes (@'c'@), these are
415+
-- A graph where the out-list references unspecified nodes (@\'c\'@), these are
416416
-- ignored.
417417
--
418418
-- > (graph, _, _) = graphFromEdges [("a", 'a', ['b']), ("b", 'b', ['c'])]

Data/IntMap/Internal.hs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,8 @@ alter f k Nil = case f Nothing of
984984
-- 'alterF' is the most general operation for working with an individual
985985
-- key that may or may not be in a given map.
986986
--
987-
-- Note: 'alterF' is a flipped version of the 'at' combinator from
988-
-- 'Control.Lens.At'.
987+
-- Note: 'alterF' is a flipped version of the @at@ combinator from
988+
-- @Control.Lens.At@.
989989
--
990990
-- @since 0.5.8
991991

@@ -1833,7 +1833,7 @@ traverseMaybeWithKey f = go
18331833

18341834
-- | Merge two maps.
18351835
--
1836-
-- @merge@ takes two 'WhenMissing' tactics, a 'WhenMatched' tactic
1836+
-- 'merge' takes two 'WhenMissing' tactics, a 'WhenMatched' tactic
18371837
-- and two maps. It uses the tactics to merge the maps. Its behavior
18381838
-- is best understood via its fundamental tactics, 'mapMaybeMissing'
18391839
-- and 'zipWithMaybeMatched'.
@@ -1850,22 +1850,22 @@ traverseMaybeWithKey f = go
18501850
-- Take, for example,
18511851
--
18521852
-- @
1853-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
1853+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
18541854
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
18551855
-- @
18561856
--
1857-
-- @merge@ will first ''align'' these maps by key:
1857+
-- 'merge' will first \"align\" these maps by key:
18581858
--
18591859
-- @
1860-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
1861-
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
1860+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
1861+
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
18621862
-- @
18631863
--
18641864
-- It will then pass the individual entries and pairs of entries
18651865
-- to @g1@, @g2@, or @f@ as appropriate:
18661866
--
18671867
-- @
1868-
-- maybes = [g1 0 'a', f 1 'b' "one", g2 2 "two", g1 3 'c', f 4 'd' "three"]
1868+
-- maybes = [g1 0 \'a\', f 1 \'b\' "one", g2 2 "two", g1 3 \'c\', f 4 \'d\' "three"]
18691869
-- @
18701870
--
18711871
-- This produces a 'Maybe' for each key:
@@ -1915,7 +1915,7 @@ merge g1 g2 f m1 m2 =
19151915

19161916
-- | An applicative version of 'merge'.
19171917
--
1918-
-- @mergeA@ takes two 'WhenMissing' tactics, a 'WhenMatched'
1918+
-- 'mergeA' takes two 'WhenMissing' tactics, a 'WhenMatched'
19191919
-- tactic and two maps. It uses the tactics to merge the maps.
19201920
-- Its behavior is best understood via its fundamental tactics,
19211921
-- 'traverseMaybeMissing' and 'zipWithMaybeAMatched'.
@@ -1932,22 +1932,22 @@ merge g1 g2 f m1 m2 =
19321932
-- Take, for example,
19331933
--
19341934
-- @
1935-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
1935+
-- m1 = [(0, \'a\'), (1, \'b\'), (3,\'c\'), (4, \'d\')]
19361936
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
19371937
-- @
19381938
--
1939-
-- @mergeA@ will first ''align'' these maps by key:
1939+
-- 'mergeA' will first \"align\" these maps by key:
19401940
--
19411941
-- @
1942-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
1943-
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
1942+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
1943+
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
19441944
-- @
19451945
--
19461946
-- It will then pass the individual entries and pairs of entries
19471947
-- to @g1@, @g2@, or @f@ as appropriate:
19481948
--
19491949
-- @
1950-
-- actions = [g1 0 'a', f 1 'b' "one", g2 2 "two", g1 3 'c', f 4 'd' "three"]
1950+
-- actions = [g1 0 \'a\', f 1 \'b\' "one", g2 2 "two", g1 3 \'c\', f 4 \'d\' "three"]
19511951
-- @
19521952
--
19531953
-- Next, it will perform the actions in the @actions@ list in order from

Data/IntMap/Merge/Lazy.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
--
4040
-- == Efficiency note
4141
--
42-
-- The 'Category', 'Applicative', and 'Monad' instances for 'WhenMissing'
43-
-- tactics are included because they are valid. However, they are
42+
-- The 'Control.Category.Category', 'Applicative', and 'Monad' instances for
43+
-- 'WhenMissing' tactics are included because they are valid. However, they are
4444
-- inefficient in many cases and should usually be avoided. The instances
4545
-- for 'WhenMatched' tactics should not pose any major efficiency problems.
4646
--

Data/IntMap/Merge/Strict.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
--
4040
-- == Efficiency note
4141
--
42-
-- The 'Category', 'Applicative', and 'Monad' instances for 'WhenMissing'
43-
-- tactics are included because they are valid. However, they are
42+
-- The 'Control.Category.Category', 'Applicative', and 'Monad' instances for
43+
-- 'WhenMissing' tactics are included because they are valid. However, they are
4444
-- inefficient in many cases and should usually be avoided. The instances
4545
-- for 'WhenMatched' tactics should not pose any major efficiency problems.
4646
--

Data/IntMap/Strict.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
-- from key of type @Int@ to values of type @v@.
2323
--
2424
-- Each function in this module is careful to force values before installing
25-
-- them in a 'Map'. This is usually more efficient when laziness is not
25+
-- them in an 'IntMap'. This is usually more efficient when laziness is not
2626
-- necessary. When laziness /is/ required, use the functions in
2727
-- "Data.IntMap.Lazy".
2828
--
@@ -60,9 +60,9 @@
6060
--
6161
-- The 'IntMap' type is shared between the lazy and strict modules, meaning that
6262
-- the same 'IntMap' value can be passed to functions in both modules. This
63-
-- means that the 'Functor', 'Traversable' and 'Data' instances are the same as
64-
-- for the "Data.IntMap.Lazy" module, so if they are used the resulting map may
65-
-- contain suspended values (thunks).
63+
-- means that the 'Functor', 'Traversable' and 'Data.Data.Data' instances are
64+
-- the same as for the "Data.IntMap.Lazy" module, so if they are used the
65+
-- resulting map may contain suspended values (thunks).
6666
--
6767
--
6868
-- == Implementation

Data/Map.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ insertLookupWithKey' :: Whoops "Data.Map.insertLookupWithKey' is gone. Use Data.
101101
insertLookupWithKey' _ _ _ _ = undefined
102102

103103
-- | This function is being removed and is no longer usable.
104-
-- Use 'foldr'.
104+
-- Use 'Data.Map.Strict.foldr'.
105105
fold :: Whoops "Data.Map.fold is gone. Use foldr."
106106
=> (a -> b -> b) -> b -> Map k a -> b
107107
fold _ _ _ = undefined

Data/Map/Internal.hs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,8 +1202,8 @@ data AreWeStrict = Strict | Lazy
12021202
-- a very large fraction of the time, you might consider using a
12031203
-- private copy of the 'Identity' type.
12041204
--
1205-
-- Note: 'alterF' is a flipped version of the 'at' combinator from
1206-
-- 'Control.Lens.At'.
1205+
-- Note: 'alterF' is a flipped version of the @at@ combinator from
1206+
-- @Control.Lens.At@.
12071207
--
12081208
-- @since 0.5.8
12091209
alterF :: (Functor f, Ord k)
@@ -1990,7 +1990,7 @@ intersection t1@(Bin _ k x l1 r1) t2
19901990
--
19911991
-- @
19921992
-- m \`restrictKeys\` s = 'filterWithKey' (\k _ -> k ``Set.member`` s) m
1993-
-- m \`restrictKeys\` s = m ``intersect`` 'fromSet' (const ()) s
1993+
-- m \`restrictKeys\` s = m ``intersection`` 'fromSet' (const ()) s
19941994
-- @
19951995
--
19961996
-- @since 0.5.8
@@ -2469,7 +2469,7 @@ traverseMaybeMissing f = WhenMissing
24692469

24702470
-- | Merge two maps.
24712471
--
2472-
-- @merge@ takes two 'WhenMissing' tactics, a 'WhenMatched'
2472+
-- 'merge' takes two 'WhenMissing' tactics, a 'WhenMatched'
24732473
-- tactic and two maps. It uses the tactics to merge the maps.
24742474
-- Its behavior is best understood via its fundamental tactics,
24752475
-- 'mapMaybeMissing' and 'zipWithMaybeMatched'.
@@ -2486,22 +2486,22 @@ traverseMaybeMissing f = WhenMissing
24862486
-- Take, for example,
24872487
--
24882488
-- @
2489-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
2489+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
24902490
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
24912491
-- @
24922492
--
2493-
-- @merge@ will first ''align'' these maps by key:
2493+
-- 'merge' will first \"align\" these maps by key:
24942494
--
24952495
-- @
2496-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
2497-
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
2496+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
2497+
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
24982498
-- @
24992499
--
25002500
-- It will then pass the individual entries and pairs of entries
25012501
-- to @g1@, @g2@, or @f@ as appropriate:
25022502
--
25032503
-- @
2504-
-- maybes = [g1 0 'a', f 1 'b' "one", g2 2 "two", g1 3 'c', f 4 'd' "three"]
2504+
-- maybes = [g1 0 \'a\', f 1 \'b\' "one", g2 2 "two", g1 3 \'c\', f 4 \'d\' "three"]
25052505
-- @
25062506
--
25072507
-- This produces a 'Maybe' for each key:
@@ -2550,7 +2550,7 @@ merge g1 g2 f m1 m2 = runIdentity $
25502550

25512551
-- | An applicative version of 'merge'.
25522552
--
2553-
-- @mergeA@ takes two 'WhenMissing' tactics, a 'WhenMatched'
2553+
-- 'mergeA' takes two 'WhenMissing' tactics, a 'WhenMatched'
25542554
-- tactic and two maps. It uses the tactics to merge the maps.
25552555
-- Its behavior is best understood via its fundamental tactics,
25562556
-- 'traverseMaybeMissing' and 'zipWithMaybeAMatched'.
@@ -2567,22 +2567,22 @@ merge g1 g2 f m1 m2 = runIdentity $
25672567
-- Take, for example,
25682568
--
25692569
-- @
2570-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
2570+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
25712571
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
25722572
-- @
25732573
--
2574-
-- @mergeA@ will first ''align'' these maps by key:
2574+
-- @mergeA@ will first \"align\" these maps by key:
25752575
--
25762576
-- @
2577-
-- m1 = [(0, 'a'), (1, 'b'), (3,'c'), (4, 'd')]
2578-
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
2577+
-- m1 = [(0, \'a\'), (1, \'b\'), (3, \'c\'), (4, \'d\')]
2578+
-- m2 = [(1, "one"), (2, "two"), (4, "three")]
25792579
-- @
25802580
--
25812581
-- It will then pass the individual entries and pairs of entries
25822582
-- to @g1@, @g2@, or @f@ as appropriate:
25832583
--
25842584
-- @
2585-
-- actions = [g1 0 'a', f 1 'b' "one", g2 2 "two", g1 3 'c', f 4 'd' "three"]
2585+
-- actions = [g1 0 \'a\', f 1 \'b\' "one", g2 2 "two", g1 3 \'c\', f 4 \'d\' "three"]
25862586
-- @
25872587
--
25882588
-- Next, it will perform the actions in the @actions@ list in order from

Data/Map/Lazy.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
--
2828
-- When deciding if this is the correct data structure to use, consider:
2929
--
30-
-- * If you are using 'Int' keys, you will get much better performance for most
30+
-- * If you are using 'Prelude.Int' keys, you will get much better performance for most
3131
-- operations using "Data.IntMap.Lazy".
3232
--
3333
-- * If you don't care about ordering, consider using @Data.HashMap.Lazy@ from the
@@ -58,9 +58,9 @@
5858
--
5959
-- == Warning
6060
--
61-
-- The size of a 'Map' must not exceed @maxBound::Int@. Violation of this
62-
-- condition is not detected and if the size limit is exceeded, its behaviour is
63-
-- undefined.
61+
-- The size of a 'Map' must not exceed @'Prelude.maxBound' :: 'Prelude.Int'@.
62+
-- Violation of this condition is not detected and if the size limit is exceeded,
63+
-- its behaviour is undefined.
6464
--
6565
--
6666
-- == Implementation

Data/Map/Merge/Lazy.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
--
4040
-- == Efficiency note
4141
--
42-
-- The 'Category', 'Applicative', and 'Monad' instances for 'WhenMissing'
43-
-- tactics are included because they are valid. However, they are
42+
-- The 'Control.Category.Category', 'Applicative', and 'Monad' instances for
43+
-- 'WhenMissing' tactics are included because they are valid. However, they are
4444
-- inefficient in many cases and should usually be avoided. The instances
4545
-- for 'WhenMatched' tactics should not pose any major efficiency problems.
4646
--

Data/Map/Merge/Strict.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
--
4040
-- == Efficiency note
4141
--
42-
-- The 'Category', 'Applicative', and 'Monad' instances for 'WhenMissing'
43-
-- tactics are included because they are valid. However, they are
42+
-- The 'Control.Category.Category', 'Applicative', and 'Monad' instances for
43+
-- 'WhenMissing' tactics are included because they are valid. However, they are
4444
-- inefficient in many cases and should usually be avoided. The instances
4545
-- for 'WhenMatched' tactics should not pose any major efficiency problems.
4646
--

0 commit comments

Comments
 (0)