From efc101131c6a0db8355c494e6d286cfecd966f86 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 11 Nov 2026 12:09:12 -0500 Subject: [PATCH 1/2] Type main!'s arguments as OsStr in the platform header --- platform/main.roc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/main.roc b/platform/main.roc index f198e3dc..9369136f 100644 --- a/platform/main.roc +++ b/platform/main.roc @@ -4,7 +4,7 @@ platform "" requires { ## The application entry point receives command-line arguments only; the ## launcher-supplied program name is available from Env.program_name!. - main! : List([Utf8(Str), UnixBytes(List(U8)), WindowsU16s(List(U16))]) => Try({}, [Exit(I32), Interrupted, ..]) + main! : List(OsStr.OsStr) => Try({}, [Exit(I32), Interrupted, ..]) } exposes [Cmd, Duration, Env, File, Http, IOErr, Locale, Monotonic, OsStr, Path, Random, Signal, Sleep, Sqlite, Stderr, Stdin, Stdout, System, Tcp, Tty, UnixSocket, Url, Utc] packages { From 94b4dfd22720295da63ab76ceb86aa1cf6637af9 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 11 Nov 2026 14:30:39 -0500 Subject: [PATCH 2/2] Write OsStr without the module qualifier --- platform/main.roc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/main.roc b/platform/main.roc index 9369136f..7d96d275 100644 --- a/platform/main.roc +++ b/platform/main.roc @@ -4,7 +4,7 @@ platform "" requires { ## The application entry point receives command-line arguments only; the ## launcher-supplied program name is available from Env.program_name!. - main! : List(OsStr.OsStr) => Try({}, [Exit(I32), Interrupted, ..]) + main! : List(OsStr) => Try({}, [Exit(I32), Interrupted, ..]) } exposes [Cmd, Duration, Env, File, Http, IOErr, Locale, Monotonic, OsStr, Path, Random, Signal, Sleep, Sqlite, Stderr, Stdin, Stdout, System, Tcp, Tty, UnixSocket, Url, Utc] packages { @@ -173,7 +173,7 @@ import Utc ## The native host removes the invocation name (argv[0]) before calling this ## function. Applications can read that value separately with Env.program_name!. -main_for_host! : List(OsStr.OsStr) => I32 +main_for_host! : List(OsStr) => I32 main_for_host! = |args| match main!(args) { Ok({}) => 0