3 ms·
Depending on your language you might be able to have it both ways - summary at the top, and implementation details down below. And it's just in the text itself
by mrkeen 2y ago
Depending on your language you might be able to have it both ways - summary at the top, and implementation details down below. And it's just in the text itself, so it's as readable in Github as it is in an IDE.
-- Top of file:
data Indexer =
Indexer { indexDocuments :: !(CollectionName -> [Doc] -> IO (Either String Int))
, indexLocalWarcFile :: !(CollectionName -> FilePath -> IO (Either String ()))
, deleteDocument :: !(CollectionName -> String -> IO (Either String ()))
, isDocDeleted :: !(CollectionName -> String -> IO (Either String (Map Text Int)))
}
-- Further down:
indexDocumentsImpl env writer metadataApi compactor registry collectionName unsortedDocs = do
let ds = sort unsortedDocs
let nDocs = length ds
...
newLocalWarcFileIndex env warcFileReader writer metadataApi compactor registry collectionName warcFile =
batchedRead warcFileReader
warcFile
newIndexify
where
newIndexify :: Vector WarcEntry -> IO ()
newIndexify ds = do
...
etc.