I just installed the latest nightly linux build and when running roc Hello.roc
on the first app of the tutorial, importing the platform from examples/interactive/cli-platform/main.roc
I get a type error saying
This #UserApp.main value is a:
Task.Task {} * [Write [Stdout]*]* ?
But toEffect needs its 1st argument to be:
InternalProgram.InternalProgram ?
Did I do something wrong?
oops, I forgot to update the tutorial in https://github.com/roc-lang/roc/pull/4071
short version: the type of main
should be Program
now - here are ways to get one of those!
https://www.roc-lang.org/examples/cli/Program
hum, I'm not sure what to change where. I tried this but failed to find Program.roc
app "hello"
packages { pf: "/home/matthieu/git/roc-lang/roc/examples/interactive/cli-platform/main.roc" }
imports [pf.Stdout, Program]
provides [main] to pf
main = Stdout.line "I'm a Roc application!" |> Program.quick
sorry really beginner here ^^
no worries! You'll want to import pf.Program
because that module comes from the CLI platform
alright I changed that and now I'm getting more errors related to an Effect.map
call. Do you want me to open a PR for this forgotten change? meanwhile I'll just skip that part of the tutorial and continue forward.
Open an issue I meant, not a PR XD
haha yeah sounds good, thank you!
if you take a look at examples/interactive/file.roc
you can see a working CLI app that uses Program
- that may help!
(we check everything in the examples/
folder on CI, so I know it's been updated)
I'll make an issue to set up testing for the snippets in the tutorial.
It took me longer than expected to figure out my second issue. I think it was an incompatibility between the nightly executable and the example files in the git repo. So today I just rebuilt from scratch with the repo instead of using the nightly and now it works as expected with the following example code:
app "hello"
packages { pf: "/home/matthieu/git/roc-lang/roc/examples/interactive/cli-platform/main.roc" }
imports [pf.Stdout, pf.Program]
provides [main] to pf
main = Stdout.line "I'm a Roc application!" |> Program.quick
I'll try to open a PR in the afternoon
right that can happen
Here is the PR to update the tutorial programs: https://github.com/roc-lang/roc/pull/4104
Last updated: Jul 05 2025 at 12:14 UTC