hi!! would someone be able to provide some code examples of arithmetic operations with correct roc file formatting. i'm really struggling to find the documentation for format and correct syntax.
right now i have this:
Num.sub 5000 30000
but i think the file needs a header and i'm not sure how to set that up? when i do
cargo run -- crates/cli/tests/subtraction_test.roc
it gives me this error:
thread 'main' panicked at crates/reporting/src/error/parse.rs:3937:14:
not yet implemented: unhandled exposes
parsing error ListStart(@7)
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
We have lots of basic mathematics tests in gen_num.rs
https://github.com/roc-lang/roc/blob/main/crates/compiler/test_gen/src/gen_num.rs
thank you!
@Brendan Hansknecht do you know how i format the header of a file?
Yeah, I would just take the header from one of the neighboring files or examples. For example, if you want a simple CLI app for testing, I would just base it of the hello world example
https://github.com/roc-lang/roc/blob/main/examples/helloWorld.roc
thank you, appreciate it!!
Last updated: Jul 05 2025 at 12:14 UTC