LIB: improve documentation

This commit is contained in:
Julian Ospald 2016-04-10 19:25:22 +02:00
parent 59d4051d84
commit bddf29671a
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
2 changed files with 9 additions and 1 deletions

View File

@ -331,8 +331,10 @@ copyFile cm from@(_ :/ RegFile {}) to@(_ :/ Dir {}) fn
copyFile _ _ _ _ = throw $ InvalidOperation "wrong input type"
-- |Unsafe version of `copyFile` without initial sanity checks. Thise
-- |Unsafe version of `copyFile` without initial sanity checks. This
-- holds the actual copy logic though and is called by `copyFile` in the end.
-- It's also used for cases where we don't need/want sanity checks
-- and need the extra bit of performance.
unsafeCopyFile :: CopyMode
-> AnchoredFile a -- ^ source file
-> AnchoredFile a -- ^ destination dir

View File

@ -389,6 +389,9 @@ readFile ff p = do
readFileUnsafe ff (cdp P.</> P.basename p)
-- |A variant of `readFile` which does not use `realpath` at all.
-- Suitable for cases where we know the paths are safe/correct
-- and need the extra bit of performance.
readFileUnsafe :: (Path Abs -> IO a)
-> Path Abs
-> IO (AnchoredFile a)
@ -442,6 +445,9 @@ readDirectoryContents getfiles ff p = do
return $ removeNonexistent fcs
-- |A variant of `readDirectoryContents` which uses `readFileUnsafe`.
-- Suitable for cases where we know the paths are safe/correct
-- and need the extra bit of performance.
readDirectoryContentsUnsafe :: (Path Abs -> IO [Path Fn])
-> (Path Abs -> IO a)
-> Path Abs