Multiple Roc Files

You can use modules to organize your code into multiple files.

Code

Hello.roc:

module
    # Only what's listed here is accessible/exposed to other modules
    [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.17.0/lZFLstMUCUvd5bjnnpYromZJXkQUrdhbva4xdBInicE.tar.br" }

import pf.Stdout
import Hello

main =
    Stdout.line! (Hello.hello "World")

Output

Run this from the directory that has main.roc in it:

$ roc main.roc
Hello World from interface!