
26 Oct
2004
26 Oct
'04
4:36 p.m.
Wolfgang Thaller writes:
On Windows, it also converts forward slashes to backward slashes.
normalizeCase :: FilePath -> FilePath
Are there enough situations where the simple but not quite correct pure normalizeCase function would be The Right Thing (or at least Sufficiently Close To The Right Thing)?
I think the use of FilePath is not a good idea to begin with. A file path should be a data type something like this, IMHO: type Segment = String data FilePath = Path [Segment] | RootedPath [Segment] You shouldn't write slashes or backslashes which are converted later, you should use a, say :/: operator to build paths portably right from the start. Peter