Remove RelC and Fn wrt #29

'Path Fn </> Path Fn' leads to incorrect semantics.
The only fix is introducing complicated type family
machinery, which isn't justified.
This commit is contained in:
2020-01-20 18:40:23 +01:00
parent 117641c419
commit 3abc68cdd6
3 changed files with 8 additions and 73 deletions

View File

@@ -1177,14 +1177,14 @@ getDirsFiles p@(MkPath fp) = do
-- | Like 'getDirsFiles', but returns the filename only, instead
-- of prepending the base path.
getDirsFiles' :: Path b -- ^ dir to read
-> IO [Path Fn]
-> IO [Path Rel]
getDirsFiles' p@(MkPath fp) = do
fd <- openFd fp SPI.ReadOnly [SPDF.oNofollow] Nothing
rawContents <- getDirectoryContents' fd
fmap catMaybes $ for rawContents $ \(_, f) ->
if FP.isSpecialDirectoryEntry f
then pure Nothing
else fmap Just $ parseFn f
else fmap Just $ parseRel f