mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-25 07:23:50 +00:00
18 lines
575 B
Text
18 lines
575 B
Text
app "test-base64"
|
|
packages { pf: "platform/main.roc" }
|
|
imports [pf.Task, Base64]
|
|
provides [main] to pf
|
|
|
|
IO a : Task.Task a []
|
|
|
|
main : IO {}
|
|
main =
|
|
when Base64.fromBytes (Str.toUtf8 "Hello World") is
|
|
Err _ -> Task.putLine "sadness"
|
|
Ok encoded ->
|
|
Task.after
|
|
(Task.putLine (Str.concat "encoded: " encoded))
|
|
\_ ->
|
|
when Base64.toStr encoded is
|
|
Ok decoded -> Task.putLine (Str.concat "decoded: " decoded)
|
|
Err _ -> Task.putLine "sadness"
|