System.FilePath propsal (Was: Cabal feedback notes)

Krasimir Angelov ka2_mail at
Tue Oct 26 09:33:43 EDT 2004

--- Simon Marlow <simonmar at> wrote:
> Last time this came up I asked for a concrete
> proposal, but no-one came
> forward with one.  I'd do it myself, but I'm kind of
> busy right now.
> Would someone care to whip up a list of functions &
> signatures?   

Ok. Here is one concrete proposal for System.FilePath.
It contains nearly all useful FilePath functions from
Cabal, .Net's System.IO.Path and Python's OS.Path.
There are only few exceptions:

   - findBinary from Cabal isn't included here. I
think that System.Directory is more appropriate place.
   - OS.Path provides expanduser function which
replaces ~ and ~user with the right home directories.
I am not sure how to do this in platform independent
way. Maybe on Windows this function must be identity.
   - OS.Path provides expandvar function which
replaces $var and ${var} with the value of the
corresponding environment variable. I am not sure
wheter this function should be there since it can be
used to replace values in any text. Maybe
System.Environment is better place for it. Another
issue is whether it must replace $var or %var% under
Windows. %var% is more natural for Windows.

Some function names are slightly different from those
in Cabal. Propsals for future extensions and better
function names are welcome.


Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FilePath.hs
Type: application/octet-stream
Size: 11966 bytes
Desc: FilePath.hs
Url :

More information about the Libraries mailing list