Processing files in a directory tree I'm new to Scala, and would appreciate any notes about a better approach, correctness, or style.

/**
 * Call proc(f) for each file in the directory tree rooted at dir.
 * 
 * proc will not be called for directories, just for files.
 */
def traverse(dir: File, proc: File =&gt; Unit): Unit = {
    dir.listFiles foreach { (f) =&gt; {
            if(f.isDirectory) {
                traverse(f, proc)
            } else {
                proc(f)
            }
        }
    }
}
Your code is fine. Nevertheless, removing unnecessary braces can increase readability:

def traverse(dir: File, proc: File =&gt; Unit): Unit =
  dir.listFiles foreach { f =&gt; if (f.isDirectory) traverse(f, proc) else proc(f) }