[Haskell] Re: System.FilePath survey

John Meacham john at repetae.net
Mon Feb 6 20:28:34 EST 2006


On Mon, Feb 06, 2006 at 03:36:17PM +0000, Simon Marlow wrote:
> So I'm of the opinion that introducing an ADT for FilePaths is something 
> that should wait until the I/O library is revised.  In the meantime, we 
> should include a String-based Data.FilePath library in Haskell'.  It's 
> not as elegant, but it's terribly practical, and that's one goal of 
> Haskell'.
> 
> As a first step, can someone package up Data.FilePath as a Cabal package 
> so that at least we can all start using the same one?

how about we take the library as is for now and then add

newtype FilePath = FilePath String

filePathToString (FilePath s) = s
stringToFilePath s = FilePath s

that way, when FilePath is replaced by something more interesting, no
code dealing with it needs to change as it is already written to an ADT
(though a simple one for now) and we could experiment with more advanced
representations without breaking anyones code.

        John


-- 
John Meacham - ⑆repetae.net⑆john⑈


More information about the Haskell mailing list