Stream: beginners

Topic: How can I see what a platform exposes


view this post on Zulip Rene Mailaender (Apr 02 2023 at 10:00):

Hey there,

I wonder how I can find what I can import into my App from a chosen platform. I expected to see that in the expose list of the platform, but in most cases this is empty. (e.g. cli-platform) So probably there is an other mechanism right? I searched the docs and zulip for an answer but couldn't find any.
Can anybody point me to the right direction or give me a quick answer? :)

thx

view this post on Zulip Anton (Apr 03 2023 at 09:19):

Hi @Rene Mailaender,
Yes, the exposes list is actually the intended place but we still have a bug when using it. You can find the list of exposed modules for basic-cli here.

view this post on Zulip Rene Mailaender (Apr 03 2023 at 09:34):

thx @Anton
I'm curious, how does roc actually know what a platform exposes in it's current state? Does it silently expose everything. So would my app be able to use e.g. InnerTask?

view this post on Zulip Anton (Apr 03 2023 at 09:35):

I'm not sure but @Richard Feldman should know

view this post on Zulip Luke Boswell (Apr 03 2023 at 09:47):

Another thing is you should be able to generate the docs for a platform with roc docs /path/to/platform/main.roc. It doesn't work for basic-cli with that bug rn. But that would be another way to see what is exposed. I assume package authors would also host docs somewhere for users in future for popular packages. I was wondering if this assumption is correct though. Would it be reasonable to use github pages for example?

view this post on Zulip Anton (Apr 03 2023 at 09:55):

I think so, with the github action @Hannes made that should be pretty easy

view this post on Zulip Richard Feldman (Apr 03 2023 at 12:47):

so the goal is:

view this post on Zulip Rene Mailaender (Apr 03 2023 at 19:24):

thx for your answers! :)
it seems for some reason the doc generation doesn't work. it only generates 3 files: favicon, styles.css and search.js. That doesn't seem right, right?
I'm using: roc nightly pre-release, built from commit 424b4aa on Fr 31 Mär 2023 09:08:14 UTC
and i tried different *.roc files. Some of my own, some from roc/examples. roc never complains. in the terminal, everything seems right.

Is there a concept of how to generate docs for a remote (installed from an url) package/platform?

view this post on Zulip Anton (Apr 04 2023 at 11:23):

it seems for some reason the doc generation doesn't work. it only generates 3 files: favicon, styles.css and search.js. That doesn't seem right, right?

I think this occurs when the exposes list in the header is empty in the main.roc. Was that the case for your tests?

view this post on Zulip Anton (Apr 04 2023 at 11:28):

Is there a concept of how to generate docs for a remote (installed from an url) package/platform?

In general I think you should be able to do this using the path to which the package is downloaded, so: roc docs /home/username/.cache/roc/packages/github.com/roc-lang/basic-cli/releases/download/0.3.1/97mY3sUwo433-pcnEQUlMhn-sWiIf_J9bPhcAFZoqY4/main.roc but for basic-cli this will not work due to this issue.

view this post on Zulip Rene Mailaender (Apr 04 2023 at 12:15):

Was that the case for your tests?
oh ok. indeed it was. i'll test that later with an expose list. thx

but for basic-cli this will not work due to this issue.
yes I know. :)

In general I think you should be able to do this using the path to which the package is downloaded
hmm I thought so.

are there any plans/ideas doing something like: roc docs ./myApp/main.roc to generate not only the docs for my app, but for all used packages and the platform together? I think rust does something similar, or am i wrong?

btw It's not meant as a complaint or something like that. I know roc is in an early stage. I'm just interested, not only in it's current state but in future ideas too. So if the answer for future ideas on this topic is, there are none, that's totally fine. ;)

you all helped me a lot already. so thank you. :)

view this post on Zulip Anton (Apr 04 2023 at 12:18):

are there any plans/ideas doing something like: roc docs ./myApp/main.roc to generate not only the docs for my app, but for all used packages and the platform together? I think rust does something similar, or am i wrong?

I don't we've discussed it before but I can't think of any reasons why we should not support that

view this post on Zulip Anton (Apr 04 2023 at 12:19):

I'll make an issue for it if no one objects


Last updated: Jul 26 2025 at 12:14 UTC