From 6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Thu, 23 Nov 2023 21:13:26 +0000 Subject: Baby steps --- main.roc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 main.roc diff --git a/main.roc b/main.roc new file mode 100644 index 0000000..94139c4 --- /dev/null +++ b/main.roc @@ -0,0 +1,19 @@ +app "roctorrent" + packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.5.0/Cufzl36_SnJ4QbOoEmiJ5dIpUxBvdB3NEySvuH82Wio.tar.br" } + imports [pf.Stdout] + provides [main] to pf + + +bDecodeStr: List U8 -> Result (List U8) [Malformatted] +bDecodeStr = \i -> + List.splitFirst i ':' + |> Result.mapErr \_err -> Malformatted + |> Result.map \{before, } -> before + +expect + res = bDecodeStr (Str.toUtf8 "foo") + res == Err Malformatted + + +main = + Stdout.line "Hello, World" -- cgit v1.2.3-ZIG