
20 Nov
2011
20 Nov
'11
8:36 p.m.
On the whole, the filepath package does an excellent job of providing basic path manipulation tools, one weakness is the inability to resolve "~/..." style POSIX paths. Python implements this with os.path.expanduser. Perhaps a similar function might be helpful in filepath? Cheers, - Ben Possible (but untested) implementation expandUser :: FilePath -> IO FilePath expandUser p = if "~/" `isPrefixOf` p then do u <- getLoginName return $ u ++ drop 2 p else return p