Kian Broderick

back to all posts

Directory formatter in Haskell

Published February 10, 2026


I had a mess of files on my computer that I wanted to have a consistent naming scheme using spaces and all lowercase. After manually renaming a few, I decided I would write a simply program to automate it. I knew how I would do it in Python, but after attending the AmeriHac Haskell hackathon last weekend I’m on a little Haskell spree, so I decided to try to do it in Haskell.

I haven’t done all that much in Haskell using IO; I’ve mostly just done math problems that are all done through computation. The most I have done is reading a text file to operate on. Fortunately Haskell has a directory library to rename and operate on the computer’s file system which made it easier. The hardest part was actually making the program rename all the files recursively through a directory, which was surprising to me since Haskell supports recursion so easily. What Haskell made very easy was making the formatter that changed the file name. After specifying the options, I could easily just compose all the pieces together as functions to get the final formatter.

I want to write a longer blog post about AmeriHac, but the thing that keeps coming to mind is what is the purpose of Haskell. It seems like in most applications a different language would be better suited for the task. The Haskell libraries and whole ecosystem just isn’t as mature as many other languages, which makes the case for using it difficult. This little project of mine probably would’ve been much easier to do in Python. It seems like the biggest reason that people use Haskell is that they like using it over other languages.