aboutsummaryrefslogtreecommitdiff
path: root/main.roc
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2023-11-23 21:13:26 +0000
committerMartin Ashby <martin@ashbysoft.com>2023-11-23 21:13:26 +0000
commit6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4 (patch)
treeaedf9bc9274ef6c62e389df86f2e98cf9a3ba337 /main.roc
downloadroctorrent-6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4.tar.gz
roctorrent-6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4.tar.bz2
roctorrent-6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4.tar.xz
roctorrent-6e6a29bcda4c1360fa1d18a7dfdf6662e0686ab4.zip
Baby steps
Diffstat (limited to 'main.roc')
-rw-r--r--main.roc19
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"