filepath- released

Julian Ospald hasufell at
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

That has some odd properties when getting length and trying to split strings. That lead to yet another experiment: OMG-WTF-8

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:


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> wrote:
>Julian Ospald <hasufell at> writes:
>> Hi,
>> this release implements support for the "abstract filepath proposal" (AFPP).
>> There are no breaking changes in the existing API.
>> Hackage:
>> More information can be found on my blog:
>This is very nice!
>The only other language mentioned is Python. Do you happen to have pointers to how other languages handle this?
>Magnus Therning                   OpenPGP: 0x927912051716CE39
>email: magnus at
>@magthe at
>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: <>

More information about the Libraries mailing list