Skip to content

Commit 4377165

Browse files
authored
Merge pull request #576 from IntersectMBO/jeltsch/private-haddock-comments
Turn private API documentation into Haddock comments
2 parents 8587bfb + 9a912d9 commit 4377165

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/Test/Database/LSMTree/Internal/Index/Ordinary.hs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ tests = testGroup "Test.Database.LSMTree.Internal.Index.Ordinary" $
101101

102102
-- * Tested type and version
103103

104-
-- The type and version of the index to which these tests refer.
104+
-- | The type and version of the index to which these tests refer.
105105
testedTypeAndVersion :: Word32
106106
testedTypeAndVersion = 0x0101
107107

108108
-- * Utilities
109109

110110
-- ** Simple index construction
111111

112-
{-
112+
{-|
113113
Constructs an index from a list of keys. The keys have the same meaning as
114114
in the vector given to the 'IndexOrdinary' data constructor.
115115
-}
@@ -118,7 +118,7 @@ indexFromLastKeyList = IndexOrdinary . fromList
118118

119119
-- ** Partitioning according to search
120120

121-
{-
121+
{-|
122122
Invokes the 'search' function to obtain a page span and partitions the key
123123
list of the index into a prefix, selection, and suffix part, which
124124
correspond to the pages before, within, and after the page span,
@@ -140,7 +140,7 @@ searchPartitioning key index@(IndexOrdinary lastKeys)
140140
splitAt (succ end) $
141141
lastKeys
142142

143-
-- Adds a search partitioning to a counterexample.
143+
-- | Adds a search partitioning to a counterexample.
144144
searchPartitioningCounterexample ::
145145
Testable prop
146146
=> Vector SerialisedKey
@@ -155,7 +155,7 @@ searchPartitioningCounterexample prefix selection suffix
155155

156156
-- ** Construction of serialised indexes, possibly with errors
157157

158-
{-
158+
{-|
159159
Constructs a potential serialised index from a block for representing the
160160
type and the version of the index, a list of blocks for representing the
161161
keys list of the index, and a block for representing the number of entries
@@ -181,14 +181,14 @@ potentialSerialisedIndex typeAndVersionBlock
181181
!(Primitive.Vector _ _ (ByteArray unliftedByteArray))
182182
= Primitive.force primitiveVector
183183

184-
{-
184+
{-|
185185
The serialisation of the type and version of the index to which these tests
186186
refer.
187187
-}
188188
testedTypeAndVersionBlock :: Primitive.Vector Word8
189189
testedTypeAndVersionBlock = byteVectorFromPrim testedTypeAndVersion
190190

191-
{-
191+
{-|
192192
Constructs blocks that constitute the serialisation of the key list of an
193193
index.
194194
-}
@@ -207,7 +207,7 @@ lastKeysBlocks lastKeys = concatMap lastKeyBlocks lastKeys where
207207
lastKeySizeAsWord16 = fromIntegral $
208208
Primitive.length lastKeyBlock
209209

210-
-- Constructs the serialisation of the number of entries of a run.
210+
-- | Constructs the serialisation of the number of entries of a run.
211211
entryCountBlock :: NumEntries -> Primitive.Vector Word8
212212
entryCountBlock (NumEntries entryCount)
213213
= byteVectorFromPrim entryCountAsWord64
@@ -216,7 +216,7 @@ entryCountBlock (NumEntries entryCount)
216216
entryCountAsWord64 :: Word64
217217
entryCountAsWord64 = fromIntegral entryCount
218218

219-
-- Constructs a correct serialised index.
219+
-- | Constructs a correct serialised index.
220220
serialisedIndex :: NumEntries -> [SerialisedKey] -> ShortByteString
221221
serialisedIndex entryCount lastKeys
222222
= potentialSerialisedIndex testedTypeAndVersionBlock
@@ -225,21 +225,21 @@ serialisedIndex entryCount lastKeys
225225

226226
-- ** Construction via appending
227227

228-
-- Yields the keys that an append operation adds to an index.
228+
-- | Yields the keys that an append operation adds to an index.
229229
appendedKeys :: Append -> [SerialisedKey]
230230
appendedKeys (AppendSinglePage _ lastKey)
231231
= [lastKey]
232232
appendedKeys (AppendMultiPage key overflowPageCount)
233233
= key : genericReplicate overflowPageCount key
234234

235-
{-
235+
{-|
236236
Yields the index that results from performing a sequence of append
237237
operations, starting with no keys.
238238
-}
239239
indexFromAppends :: [Append] -> IndexOrdinary
240240
indexFromAppends appends = indexFromLastKeyList (concatMap appendedKeys appends)
241241

242-
{-
242+
{-|
243243
Yields the serialized key list that results from performing a sequence of
244244
append operations, starting with no keys.
245245
-}
@@ -252,7 +252,7 @@ lastKeysBlockFromAppends appends = lastKeysBlock where
252252
lastKeysBlock :: Primitive.Vector Word8
253253
lastKeysBlock = Primitive.concat (lastKeysBlocks lastKeys)
254254

255-
{-
255+
{-|
256256
Incrementally constructs an index, using the functions 'new', 'append', and
257257
'unsafeEnd'.
258258
-}
@@ -498,7 +498,7 @@ instance Arbitrary SearchableIndex where
498498
and (zipWith (<=) lastKeys' (List.tail lastKeys'))
499499
]
500500

501-
-- A byte string that is too short to be a serialised index.
501+
-- | A byte string that is too short to be a serialised index.
502502
newtype TooShortByteString = TooShortByteString ShortByteString
503503
deriving stock Show
504504

0 commit comments

Comments
 (0)