Hi,
I'am not able to generate docs for a package that is depending on a platform.
Here is my main.roc
:
package [
Math,
] {
pf: "https://github.com/roc-lang/basic-cli/releases/download/0.11.0/SY4WWMhWQ9NvQgvIthcv15AUeA7rAIJHAHgiaSHGhdY.tar.br",
}
And here is my Math.roc
:
module [add]
import pf.Task
## add a + b
add = \a, b ->
a + b
roc docs ./main.roc
just hangs and nothing happens.
When the import is commented out:
# import pf.Task
then the docs are generated instantly.
Am I doing something wrong?
// I'm using the latest roc nighly
Hi Artur,
packages can not have a platform, so I expect that is the problem. Can you make an issue? We should produce a nice error message in this case.
Hmm, but I do have a package that is a thin http client wrapper, and it uses the Task and Http modules from basic-cli.
And it is running without any problem.
Only the docs won't generate.
Ok :p this is the first package I've seen that uses a platform. I will summon @Richard Feldman to make sure :)
Packages aren't supposed to be able to import from platforms
This is where module params are supposed to be required
The package should indirectly depend on the platform through passed in functions.
That said, I'm not sure the exact state today (for example, no task as built-in yet and probably no specific code to restrict imports)
I know that module params will solve this issue.
But for now, this is the only way to write e.g. webdriver client package :D
Yeah, I would go with forking basic-cli for now
I think the "correct" way to do that today would be to pass in lambdas to each function. Probably a struct of lambdas that contain a set of functions you might need.
ok, thanks for help.
Can't wait for the module params :heart:
We should produce a nice error message in this case.
I made #6850 for this.
Last updated: Jul 05 2025 at 12:14 UTC