Proposal: System.FilePath: current directory should be ".", not ""

Felipe Lessa felipe.lessa at gmail.com
Wed Nov 4 06:56:11 EST 2009


On Wed, Nov 4, 2009 at 8:00 AM, Simon Marlow <marlowsd at gmail.com> wrote:
> the property doesn't hold any more because dropFileName "foo" == "./". So I
> worked around cases like this with an internal version of splitFileName with
> the old semantics.  This isn't a big problem - it just means we get to keep
> some of these nice simple equality properties, which are arguably wrong
> anyway, and fewer "./" prefixes will show up to surprise users.

If FilePath was a newtype, could its Eq instance not distinguish
between "foo" and "./foo"?  Note that we must distinguish "./foo/../"
of "./" because this may not be valid ("foo" does not exist) or may be
something different ("foo" is a symlink).  This Eq instance would just
eat all superfluous "./".

Cheers,

-- 
Felipe.


More information about the Libraries mailing list