filepath-1.4.100.0 released
Julian Ospald
hasufell at posteo.de
Sat Jul 16 08:03:22 UTC 2022
Rust converts to an internal encoding that seems to be a common representation across platforms: WTF-8
https://simonsapin.github.io/wtf-8/
That has some odd properties when getting length and trying to split strings. That lead to yet another experiment: OMG-WTF-8
https://github.com/kennytm/omgwtf8
I'm not sure this is a sensible path. I much prefer the "don't touch the bytes".
Erlang on the other hand seems to try to decode as UTF-8 (or something else you tell it to on startup) and falls back to "raw filenames" if decoding of a filepath fails:
* https://www.erlang.org/doc/man/filename.html
* https://www.erlang.org/doc/apps/stdlib/unicode_usage.html#notes-about-raw-filenames
This wouldn't be too hard to do in Haskell, as something like:
data OsPath = OsPath { filepath = Maybe String, rawFilepath = ShortByteString }
But I believe this is questionable API for a low-level library. Libraries building on top of 'filepath' can easily provide such an API.
I'm not sure if there's any language that does the same as AFPP.
On July 16, 2022 6:02:39 AM UTC, Magnus Therning <magnus at therning.org> wrote:
>
>Julian Ospald <hasufell at posteo.de> writes:
>
>> Hi,
>>
>> this release implements support for the "abstract filepath proposal" (AFPP).
>> There are no breaking changes in the existing API.
>>
>> Hackage: https://hackage.haskell.org/package/filepath-1.4.100.0
>>
>> More information can be found on my blog:
>> https://hasufell.github.io/posts/2022-06-29-fixing-haskell-filepaths.html
>
>This is very nice!
>
>The only other language mentioned is Python. Do you happen to have pointers to how other languages handle this?
>
>/M
>
>--
>Magnus Therning OpenPGP: 0x927912051716CE39
>email: magnus at therning.org
>@magthe at mastodon.technology http://magnus.therning.org/
>
>It is better to keep your mouth shut and appear stupid than to open it
>and remove all doubt.
> — Mark Twain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20220716/339b3d31/attachment.html>
More information about the Libraries
mailing list