Permalink
Browse files

Fix benchmark finding to respect directory path

  • Loading branch information...
1 parent 4891ee2 commit e6677597d225250c2ef4120223888e937cfacd65 @dmpots committed Aug 19, 2010
Showing with 7 additions and 6 deletions.
  1. +7 −6 FibonFind.hs
View
@@ -50,20 +50,21 @@ bmGroups baseDir = do
dirs <- try (getDirectoryContents baseDir) :: IO (Either IOError [FilePath])
case dirs of
Left _ -> return []
- Right ds -> removeBadEntries ds
+ Right ds -> removeBadEntries baseDir ds
bmInstances :: FilePath -> [FilePath] -> IO [[String]]
bmInstances baseDir groups = do
- let paths = map (baseDir</>) groups
+ let paths = map (baseDir </>) groups
bms <- mapM getDirectoryContents paths
- mapM removeBadEntries bms
+ mapM (\(p, bm) -> removeBadEntries p bm) (zip paths bms)
removeDotFiles :: [FilePath] -> [FilePath]
removeDotFiles = filter (\d -> not ("." `isPrefixOf` d))
-removeBadEntries :: [FilePath] -> IO [FilePath]
-removeBadEntries dirs = do
- noFiles <- filterM doesDirectoryExist dirs
+removeBadEntries :: FilePath -> [FilePath] -> IO [FilePath]
+removeBadEntries baseDir dirs = do
+ let paths = map (baseDir </>) dirs
+ noFiles <- filterM (\d -> doesDirectoryExist (baseDir </> d)) dirs
return (removeDotFiles noFiles)
moduleHeader :: String

0 comments on commit e667759

Please sign in to comment.