pathwalk-0.2.0.0: Path walking utilities for Haskell programs

Safe HaskellSafe
LanguageHaskell2010

System.Directory.PathWalk

Synopsis

Documentation

pathWalk :: FilePath -> (FilePath -> [FilePath] -> [FilePath] -> IO ()) -> IO () Source

pathWalk recursively enumerates the given root directory, calling callback once per directory with the traversed directory name, a list of subdirectories, and a list of files.

The subdirectories and file names are always relative to the root given.

pathWalk "src" $ \dir subdirs files -> do
  forM_ files $ \file -> do
    when ("Test.hs" `isSuffixOf` file) $ do
      registerTestFile $ dir </> file