apfelmus apfelmus at
Mon Dec 10 05:47:16 EST 2007

Neil Mitchell wrote:
>>> I'm having some problems using filepath in GHC. [...]
>> I'm sure this has been said before: using the type string
>> to avoid an ADT is generally a bad idea.
> It's been said loads of times before. However, at this point we've got
> a FilePath library based on type FilePath = String in the base
> libraries.

which is unfortunate. I guess life would be much easier with an ADT.

Slightly OT, an ADT is probably the only way to deal with files on the 
classic MacOS. While it had some crude form of file paths (with ":" as 
separator), the "real" file operations used abstract references to 
directories and files (implemented as integer IDs). When moving a file, 
it would keep its ID, which means that aliases (aka "symbolic links") 
wouldn't break when moving their destination around. This behavior is 
still available on MacOS X, there are two forms of symbolic links: POSIX 
style symlinks and those aliases which are generated by the Finder. 
Also, moving a file while editing it is possible, too.


More information about the Libraries mailing list