[Haskell-cafe] os.path.expanduser analogue

2011-11-20 Thread Ben Gamari
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

Re: [Haskell-cafe] os.path.expanduser analogue

2011-11-20 Thread Brandon Allbery
On Sun, Nov 20, 2011 at 20:36, Ben Gamari bgamari.f...@gmail.com wrote: expandUser :: FilePath - IO FilePath expandUser p = if ~/ `isPrefixOf` p then do u - getLoginName return $ u ++ drop 2 p else return p expandUser ~ =

Re: [Haskell-cafe] os.path.expanduser analogue

2011-11-20 Thread Ben Gamari
On Sun, 20 Nov 2011 21:02:30 -0500, Brandon Allbery allber...@gmail.com wrote: On Sun, Nov 20, 2011 at 20:36, Ben Gamari bgamari.f...@gmail.com wrote: [Snip] Although arguably there should be some error checking. Thanks for the improved implementation. I should have re-read my code before