I know I said my next directory recurser would be in Ruby, but Haskell has drawn my attention in a big way. Here's what I came up with...
module Main where
main = do
[recDir] <- getArgs
printDirectory path = do
contents <- getDirectoryContents path
mapM_ (\f -> do
let newPath = (path ++ "/" ++ f)
isaDir <- doesDirectoryExist newPath
then printDirectory newPath
else putStrLn newPath
) (drop 2 contents)
Haskell seems like a pretty sweet language that I can learn a lot from. The pattern matching is very sweet and I'm looking forward to having a good understanding of Monads.