The pathwalk package

[ Tags: library, mit, system ] [ Propose Tags ]

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]


Dependencies base (>=3 && <5), directory (>=1.2), filepath (>=1.3), transformers (>= [details]
License MIT
Author Christine Dodrill
Category System
Home page
Source repo head: git clone
Uploaded Wed Oct 28 15:08:16 UTC 2015 by chadaustin
Distributions LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 1947 total (64 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-10-30 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees