From 6bcb352b903d8edf38d68eaa786d165ef19c11c4 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Thu, 1 Oct 2026 21:18:36 +0200 Subject: [PATCH] echo platform examples --- examples/basic.roc | 7 ++----- examples/tests.roc | 7 ++----- package/Path.roc | 6 +++--- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/examples/basic.roc b/examples/basic.roc index db85027..1dbe49a 100644 --- a/examples/basic.roc +++ b/examples/basic.roc @@ -1,14 +1,11 @@ app [main!] { - pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/1.0.0/AnZoxzoGPtSGQ15EQh6pBeeaHJ7aizP9MQhK81dES3Uq.tar.zst", path: "../package/main.roc", } -import pf.Stdout import path.Path -main! : List(Str) => Try({}, [Exit(I32), StdoutErr(Str), ..]) -main! = |_args| { +main! = |_| { file_path = Path.join("src", "main.roc") - Stdout.line!(Path.display(file_path))? + echo!("${Path.display(file_path)}\n") Ok({}) } diff --git a/examples/tests.roc b/examples/tests.roc index 8774fcd..23276d4 100644 --- a/examples/tests.roc +++ b/examples/tests.roc @@ -1,17 +1,14 @@ app [main!] { - pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/1.0.0/AnZoxzoGPtSGQ15EQh6pBeeaHJ7aizP9MQhK81dES3Uq.tar.zst", path: "../package/main.roc", } -import pf.Stdout import path.Path quoted_path : Path.Path quoted_path = "config.txt" -main! : List(Str) => Try({}, [Exit(I32), StdoutErr(Str), ..]) -main! = |_args| { - Stdout.line!("Run `roc test examples/tests.roc` to exercise the path package examples.")? +main! = |_| { + echo!("Run `roc test examples/tests.roc` to exercise the path package examples.\n") Ok({}) } diff --git a/package/Path.roc b/package/Path.roc index 7f1de4a..1224247 100644 --- a/package/Path.roc +++ b/package/Path.roc @@ -94,7 +94,7 @@ Path :: [ Err(NotFound) => Ok(path) } } - } + } ## Returns the filename extension without the leading dot. ext : Path -> Try(Path, [IsDirPath, EndsInDots]) @@ -222,7 +222,7 @@ utf16_to_utf8 = |remaining, out, index| [unit, .. as rest] => utf16_to_utf8(rest, append_code_point_utf8(out, U16.to_u32(unit)), index + 1) - } + } utf16_to_utf8_lossy : List(U16) -> List(U8) utf16_to_utf8_lossy = |u16s| utf16_to_utf8_lossy_help(u16s, []) @@ -245,7 +245,7 @@ utf16_to_utf8_lossy_help = |remaining, out| [unit, .. as rest] => utf16_to_utf8_lossy_help(rest, append_code_point_utf8(out, U16.to_u32(unit))) - } + } append_code_point_utf8 : List(U8), U32 -> List(U8) append_code_point_utf8 = |out, code_point|