app [main!] { pf: platform "test/fx/platform/main.roc" }
import pf.Stdout
import pf.Stdin
top_dict = Dict.single("a", "b") # Comptime-evaluated
main! = || {
key = Stdin.line!() # Force runtime-evaluation
match Dict.get(top_dict, key) {
Ok(value) => Stdout.line!(value)
Err(_) => Stdout.line!("missing")
}
}
roc check and roc build both report no errors, but echo a | roc --no-cache main.roc prints:
Expected: b.
Tested on NixOS, x86_64, Roc 1299a2ca8bbdf3fab1eb9ec65335df6b4fb5092d.
roc checkandroc buildboth report no errors, butecho a | roc --no-cache main.rocprints:Expected:
b.Tested on NixOS, x86_64, Roc
1299a2ca8bbdf3fab1eb9ec65335df6b4fb5092d.