[Haskell-cafe] Re: ANN: System.FilePath 0.10

Simon Marlow simonmarhaskell at gmail.com
Wed Nov 8 07:36:02 EST 2006


Neil Mitchell wrote:

> ANNOUNCEMENT:
> 
> I am hereby announcing System.FilePath 0.10, which hopefully is pretty
> close to final now. This library manipulates FilePath's correctly on
> both Posix and Windows.
> 
> http://www-users.cs.york.ac.uk/~ndm/projects/libraries.php#filepath
> 
> (Includes a darcs repo, a .tar.gz, haddock documentation etc)
> 
> In this version I have made reasonably large changes:
> 
> * Lots of functions gone (temporary file handling, canonicalization,
> drive manipulation, directory creation,  directory enumeration) -
> pretty much down to only pure (non-IO methods) left.
> 
> * 3 new methods (asFile, isFile, asDirectory - look up the docs for
> their meanings, but they are pretty small)
> 
> * Renamed functions to follow the scheme replace/take/drop instead of
> set/get/drop - as suggested by Simon Marlow (since set/get implies
> state operations in Haskell)

Looks good! I have a few small further suggestions:

   - remove addFileName: it does the same thing as combine, or rather
     the difference is subtle and not mentioned in the docs.  It's
     subsumed by combine, anyway.

   - remove isDirectory.  I think its presence is confusing, e.g
     forall x. isDirectory (takeDirectory x) == False!
     Also it's not really correct; "/bin/" means something subtly different to
     "/bin" on Unix systems.  Similarly isFile, asFile, asDirectory could
     be removed, I think.

   - Use the terminology "search path" consistently for anything to
     do with $PATH. i.e.
     fileSeparator => searchPathSeparator,
     isFileSeparator => isSearchPathSeparator,
     splitFiles => splitSearchPath
     also, move fileSeparator, isFileSeparator into the $PATH section
     in the docs (or change "basic functions" to "separator predicates").

   - remove splitPath: splitDirectories is enough.  I'd rename it
     to splitPathComponents, though.

   - shortPath => relativeToCurrentDirectory
     shortPathWith => makeRelativePath

Cheers,
	Simon



More information about the Haskell-Cafe mailing list