diff options
-rw-r--r-- | main.roc | 19 |
1 files changed, 19 insertions, 0 deletions
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" |