Ian Lynagh igloo at
Sun Sep 30 17:35:41 CEST 2012

On Sun, Sep 30, 2012 at 03:24:14PM +0100, Ben Millwood wrote:
> On Fri, Sep 28, 2012 at 9:16 PM, Herbert Valerio Riedel <hvr at> wrote:
> > I don't know whether this might the reason (or whether it is relevant at
> > all for the API at hand) but you can't implement this function properly
> > w/o turning it into an IO action, since you need to be able to
> > introspect the filesystem, because under POSIX at least, you can easily
> > construct a filesystem, which exhibits the following confusing
> > behaviour:
> I have two comments on this behaviour:
> 1. "confusing" is not the same as "wrong"
> 2. surely this issue can be avoided by using something like
> System.Directory.canoncalizePath before calling makeRelative. I think
> doing things that way would separate the pure and IO parts of the
> algorithm much better, and allow users to ignore the possibility of
> symlinks when that was appropriate for their use.

In my use, at least one of the paths didn't actually exist on the
filesystem, so canonicalising the path would have failed.


More information about the Libraries mailing list