Multiple Roc Files

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

Code

Hello.roc:

module
    # Only what's in 'exposes' is accessible 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.10.0/vNe6s9hWzoTZtFmNkvEICPErI9ptji_ySjicO6CkucY.tar.br" }

import pf.Stdout
import pf.Task
import Hello

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

Output

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

$ roc run
Hello World from interface!