In https://github.com/roc-lang/roc/pull/8787 @Luke Boswell mentioned there was a design decision to not have module. I'm confused what is meant by that.
This thread / Google doc might be helpful: https://roc.zulipchat.com/#narrow/channel/304641-ideas/topic/static.20dispatch.20revisions/near/543083916
Richard Feldman said:
I wrote up some design ideas for improving static dispatch - feedback welcome! https://docs.google.com/document/d/12URaMmsgatVVwW-paKNWeCAsc862Cqp-npcUzqRk704/edit?usp=sharing
What's the status on this? is it decided or still in-process? Is there a decision platform like loomio or something that the core devs use?
I think the builtins moved into their own module Builtin.roc as an evolution from implementing this
Otherwise I think all of that is implemented
from experimentation it looks like currently the only way to import a module is putting it in platform folder, is that right?
Yeah I think we have a bug.
I just tried this
# Hello.roc
Hello := [].{
say : () -> Str
say = || {
"Hello, World!"
}
}
app [main!] { pf: platform "../platform/main.roc" }
import pf.Stdout
import Hello
main! = |_args| {
Stdout.line!(Hello.say())
Ok({})
}
$ roc examples/hello_world.roc
-- MODULE NOT FOUND ------------------------------
The module Hello was not found in this Roc project.
You're attempting to use this module here:
┌─ examples/hello_world.roc:4:1
│
4 │ import Hello
│ ^^^^^^^^^^^^
-- UNDEFINED VARIABLE ----------------------------
Nothing is named say in this scope.
Is there an import or exposing missing up-top?
┌─ examples/hello_world.roc:7:18
│
7 │ Stdout.line!(Hello.say())
│ ^^^^^^^^^
Found 2 error(s) and 0 warning(s) for examples/hello_world.roc.
Ahk, I think this is due to roc check and roc build etc using different code paths.
Thats why i avoid both lol and just do roc <filename>
I'm going to have a crack at refactoring things a bit to fix this and re-enable some of those module tests
Made a start here https://github.com/roc-lang/roc/pull/8794
It needs a fair bit of cleanup. I want to re-enable a lot of the module tests first and get them working before I spend too much time polishing
Fixed the above in https://github.com/roc-lang/roc/pull/8794
Can someone have a look at that when they get a chance. :smiley:
So It seems that this "Types as modules" thing is in the process of being landed already (well, ok, not already I just didn't see it for nearly 3 months :smile:)?
Last updated: Jun 16 2026 at 16:19 UTC