Multiple Roc Files
You can use modules to organize your code into multiple files.
Code
Hello.roc:
# Only what's listed here is accessible/exposed to other modules module [hello] hello : Str -> Str hello = \name -> "Hello $(name) from interface!"
main.roc:
app [main!] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.18.0/0APbwVN1_p1mJ96tXjaoiUCr8NBGamr8G8Ac_DrXR-o.tar.br" } import pf.Stdout import Hello main! = \_args -> Stdout.line! (Hello.hello "World")
Output
Run this from the directory that has main.roc
in it:
$ roc main.roc Hello World from interface!