[Haskell-cafe] Filesystem questions

Yitzchak Gale gale at sefer.org
Sat Oct 13 17:27:13 EDT 2007

Andrew Coppin wrote:
>> Is there a way to get rid of "." and ".." in the results?

Brandon S. Allbery wrote:
> Manual filtering is always required, whether C, Perl, Haskell, etc.
> I dunno, maybe python filters them for you or something.

Correct, Python filters them out. This is clearly the correct
behavior. That is what is needed in the vast majority
of cases, and it is still reasonably easy to deal
with the unusual cases.

It is too bad that Haskell is among the many languages
that get this wrong.

Python also has os.walk, a very convenient functional (sort of)
tool for recursing through directories. (It sounds trivial, but
it is not, there are enough annoying details that this function
saves huge amounts of time.) Very embarrassing that Haskell
is missing this.

How about a built-in function that represents a directory tree
as a lazy Data.Tree?


More information about the Haskell-Cafe mailing list