[Haskell-cafe] RE: ANN: System.FilePath 0.9

Neil Mitchell ndmitchell at gmail.com
Wed Jul 26 15:19:47 EDT 2006


Hi

> Ok, this is a good use case.  What should wget do if "isValid" fails?
isValid (makeValid x) == True

makeValid is system dependant, and unspecified in its behaviour,
although obviously some kind of closeness to the original would be
ideal. So what if isValid fails and we don't have this?

> > > As you acknowledge, it's a crap-shoot.  So what's the point?
> > Its a case of reality, at the moment people use == to test if two file
> > paths are equal, at least this is a better test.
> Why is it better?

Because its right more often, so pragmatically, is better

> > >I think of that as a separate module, because extensions have no meaning
> >> to the system and can be done with portable, functional code, as far as
> > > I understand.
> > Not really, what about getExtension "file.ext\lump" - the answer is ""
> > on windows and ".ext\lump" on Posix.
> You would only call the extension functions on a segment name.

So this system independant extension module is dependant on a platform
specific FilePath module? Or do you demand people make two function
calls to get the extension? I think having extensions in this module
is the pragmatic and useful thing to do.

> > Not to the system, but some programs like to make a difference.
>
> How does it make a difference?  Do you have an answer that applies
> uniformly to all programs?  If not, aren't we just walking down a blind
> alley?  I've heard that Emacs treats double-separators specially.  Do we
> account for that too?

Haskell makes the difference, runInteractiveCommand vs runInteractiveProcess

> Maybe the trailing slash is important enough to take into account.  But
> it complicates things, and the problem is hard enough with out it.  So I
> say, leave it out.

Originally I left it out, writing quick check properties persudaded me
to put it back in, because it seems to make things more regular. But
I'm not massively tied to this, and I'm slowly thinking I might be
wrong, although not convinced either way yet.

Thanks

Neil


More information about the Haskell-Cafe mailing list