Abstract FilePath Proposal

Herbert Valerio Riedel hvriedel at gmail.com
Sat Jun 27 13:42:22 UTC 2015


On 2015-06-27 at 14:11:52 +0200, amindfv at gmail.com wrote:

[...]

>>> - `writeFile "doo/foo.bar" ...`
>>>  `_ <- readFile ("doo" </> "foo" <.> "bar")`
>>> 
>>>  This will break unless -XOverloadedStrings happens to be enabled

[...]

> Just to be clear, every existing "creation" of a FilePath (without
> OverloadedStrings) will be broken, right?
>
> So e.g. 'writeFile "test.txt" "test"' will be just as broken as
> 'writeFile ("foo" </> "test.txt") "test"' (or the '++' version)

That's right; w/o OverloadedStrings, you'd have to write e.g.

  writeFile (toFilePath "test.txt") "test"

(which will be possible to write as soon as `filepath` starts exposing
the forward-compat `{to,from}FilePath` conversion functions)



More information about the Libraries mailing list