- getDir' dirPath
- = getDirectoryContents (dirPath </> encodePageName dir)
- >>=
- return . S.fromList . map (m dirPath) . filter f
+ getDir' basePath
+ = do let childDirPath = basePath </> encodePageName dir
+ exists <- doesDirectoryExist childDirPath
+ if exists then
+ getDirectoryContents childDirPath
+ >>=
+ return . S.fromList . map (m basePath) . filter f
+ else
+ return S.empty