Path walking utilities for Haskell programs

Version on this page:
LTS Haskell 13.25:
Stackage Nightly 2019-06-12:
Latest on Hackage:

See all snapshots pathwalk appears in

MIT licensed by Christine Dodrill
Maintained by

Module documentation for

There are no documented modules for this package.

System.Directory.PathWalk is an implementation of Python's excellent os.walk function. Given a root directory, it recursively scans all subdirectories, calling a callback with directories and files it finds. Importantly, it calls the callback as soon as it finishes scanning each directory to allow the caller to begin processing results immediately.

Maximum memory usage is O(N+M) where N is the depth of the tree and M is the maximum number of entries in a particular directory.

import System.Directory.PathWalk

pathWalk "some/directory" $ \root dirs files -> do
  forM_ files $ \file ->
    when (".hs" `isSuffixOf` file) $ do
      putStrLn $ joinPath [root, file]
Depends on 4 packages:
Used by 2 packages:
comments powered byDisqus