mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 17:17:26 +00:00
15 lines
473 B
Text
15 lines
473 B
Text
app [main!] { pf: platform "platform/main.roc" }
|
|
|
|
import Base64
|
|
import pf.Host
|
|
|
|
main! : {} => {}
|
|
main! = \{} ->
|
|
when Base64.from_bytes(Str.toUtf8("Hello World")) is
|
|
Err(_) -> Host.put_line!("sadness")
|
|
Ok(encoded) ->
|
|
Host.put_line!(Str.concat("encoded: ", encoded))
|
|
|
|
when Base64.to_str(encoded) is
|
|
Ok(decoded) -> Host.put_line!(Str.concat("decoded: ", decoded))
|
|
Err(_) -> Host.put_line!("sadness")
|