id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
3456,Add FilePath -> String decoder,judahj,,"Currently, !FilePaths on POSIX systems are represented as raw
bytes in a String.  When this last came up on the mailing list, the general
consensus was to make !FilePath an abstract datatype representing paths as
Strings on Windows and raw bytes on POSIX systems.  However, such a change is
sure to break some existing code.

As a small step towards that goal, I propose adding the following two functions
to the System.IO module:

{{{
filePathToString :: FilePath -> IO String
getFilePathToStringFunc :: IO (FilePath -> String)
}}}

This functionality is implemented in the attached patch; Haddock docs are here:
http://code.haskell.org/~judah/new-io-docs/System-IO.html#v%3AfilePathToString

On POSIX those functions decode according to the current locale, so they ought to be in the IO
monad.  I think that the latter function will be easier to integrate into existing pure code.

On Windows, those functions are just `return` and `return id`, respectively, since GHC already treats
!FilePaths as Strings on that platform.

Discussion deadline: September 9",proposal,closed,normal,Not GHC,libraries/base,6.10.4,wontfix,,,Unknown/Multiple,Unknown/Multiple,None/Unknown,Unknown,,,,
