Henning Thielemann wrote:

> Udo Stenzel wrote:
> 
> > The same thoughts apply to filenames.  Make them [Word8] and convert
> > explicitly.  By the way, I think a path should be a list of names (that
> > is of type [[Word8]]) and the library would be concerned with putting in
> > the right path separator.  Add functions to read and show pathnames in
> > the local conventions and we'll never need to worry about path
> > separators again.
> 
> I even plead for an abstract data type FilePath which supports operations
> like 'enter a directory', 'go one level higher' and so on.

Are you referring to "pure" operations on the FilePath, e.g. appending
and removing entries? That's reasonable enough. But it needs to be
borne in mind that there's a difference between:

        setCurrentDirectory ".."
and:
        dir <- getCurrentDirectory
        setCurrentDirectory $ parentDirectory dir

[where parentDirectory is a pure FilePath -> FilePath function.]

if the last component in the path is a symlink.

If you want to make FilePath an instance of Eq, the situation gets
much more complicated.

-- 
Glynn Clements <[EMAIL PROTECTED]>
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to