Prefer foldl as the underlying implementation is tail recursive (this is generally true for many functional languages)