LIB: improve documentation
This commit is contained in:
parent
59d4051d84
commit
bddf29671a
@ -331,8 +331,10 @@ copyFile cm from@(_ :/ RegFile {}) to@(_ :/ Dir {}) fn
|
|||||||
copyFile _ _ _ _ = throw $ InvalidOperation "wrong input type"
|
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.
|
-- 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
|
unsafeCopyFile :: CopyMode
|
||||||
-> AnchoredFile a -- ^ source file
|
-> AnchoredFile a -- ^ source file
|
||||||
-> AnchoredFile a -- ^ destination dir
|
-> AnchoredFile a -- ^ destination dir
|
||||||
|
@ -389,6 +389,9 @@ readFile ff p = do
|
|||||||
readFileUnsafe ff (cdp P.</> P.basename p)
|
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)
|
readFileUnsafe :: (Path Abs -> IO a)
|
||||||
-> Path Abs
|
-> Path Abs
|
||||||
-> IO (AnchoredFile a)
|
-> IO (AnchoredFile a)
|
||||||
@ -442,6 +445,9 @@ readDirectoryContents getfiles ff p = do
|
|||||||
return $ removeNonexistent fcs
|
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])
|
readDirectoryContentsUnsafe :: (Path Abs -> IO [Path Fn])
|
||||||
-> (Path Abs -> IO a)
|
-> (Path Abs -> IO a)
|
||||||
-> Path Abs
|
-> Path Abs
|
||||||
|
Loading…
Reference in New Issue
Block a user