System.FilePath propsal (Was: Cabal feedback notes)
Andrew Pimlott
andrew at pimlott.net
Tue Oct 26 19:47:37 EDT 2004
On Tue, Oct 26, 2004 at 11:43:40AM -0700, Krasimir Angelov wrote:
> --- Andrew Pimlott <andrew at pimlott.net> wrote:
> > You don't seem to address the problem of volumes or
> > drives (a:, c:). I don't think you can punt this.
>
> The drives are handled implicitly. They are always
> part of directory name.
Well, for example you couldn't write a file picker with this API,
because you can't ask for all the roots. Maybe that's enough, because
pathInits can be used to find the root for a given file (the first
element of pathInits being the root).
> > Be very explicit in the documentation about what
> > your model of a path is. Most libraries implictly
> > rely upon some form of unix conventions, without
> > pinning them down. I find it hard to use File::Spec
> > without trial and error.
>
> The Haddock documentation can be improved.
This isn't mostly about the documentation, it's about having a model in
mind when you design the library. What's your model of a path? For
example, what should splitFileName "/" (unix) or splitFileName "." be,
and why? I can't think of any answers that are consistent with the type
(FilePath -> (String, String)).
Andrew
More information about the Libraries
mailing list