Type conversions

If the path is decoded successfully, the result is a Right
containing the decoded text. Successfully decoded text can be
converted back to the original path using fromText.

If the path cannot be decoded, the result is a Left containing an
approximation of the original path. If displayed to the user, this
value should be accompanied by some warning that the path has an
invalid encoding. Approximated text cannot be converted back to the
original path.

This function ignores the user’s locale, and assumes all
file paths are encoded in UTF8. If you need to display file paths
with an unusual or obscure encoding, use encode and then decode
them manually.

Attempt to convert a FilePath to a string suitable for use with
functions in System.IO. The contents of this string are
platform‐dependent, and are not guaranteed to be
human‐readable. For converting FilePaths to a
human‐readable format, use toText.

Attempt to parse a FilePath from a string suitable for use
with functions in System.IO. Do not use this function for parsing
human‐readable paths, as the character set decoding is
platform‐dependent. For converting human‐readable
text to a FilePath, use fromText.