Create an OS string from UTF-8 text. The host lowers this text to the active OS representation.
OsStr
:= [
Utf8(Str),
UnixBytes(List(U8)),
WindowsU16s(List(U16)),
]
Represent operating-system strings without losing non-Unicode data.
Native Unix bytes and Windows UTF-16 units roundtrip through host effects;
use display only when a lossy representation is acceptable.
Create a UTF-8 text OS string.
Create a Unix OS string from a Roc string by storing its UTF-8 bytes.
unix_bytes : List(U8) -> OsStr
Create a Unix OS string from raw bytes without validating UTF-8.
Create a Windows OS string from a Roc string by storing its UTF-16 code units.
windows_u16s : List(U16) -> OsStr
Create a Windows OS string from raw UTF-16 code units.
from_quote : Str -> Try(OsStr, [BadQuotedBytes(Str)])
Build an OS string from a quoted string literal.
from_interpolation : Str, Iter((Str, Str)) -> OsStr
Build a UTF-8 OS string from an interpolated string literal.
to_str_try : OsStr -> Try(Str, [InvalidStr(U64)])
Convert an OS string to a string if its raw representation is valid text.
Convert an OS string to a best-effort display string, replacing invalid text with U+FFFD. This representation is lossy and must not be used for roundtripping.
to_inspect : OsStr -> Str
Customize debug output for Str.inspect.
Compare OS strings by their exact tagged representation.
Hash OS strings consistently with exact tagged equality.
Expose the host ABI representation.
Build an OS string from the host ABI representation.