roc-lang / examples

All kinds of Roc examples
https://www.roc-lang.org/examples
Creative Commons Zero v1.0 Universal
30 stars 17 forks source link

example suggestion: minimal two file project #127

Closed Anton-4 closed 10 months ago

Anton-4 commented 10 months ago

inspiration

frisoft commented 10 months ago

Can I work on this one, @Anton-4? How should it be titled? "Use of an Interface module" or just "Interface modules"?

lukewilliamboswell commented 10 months ago

I'd say go for it 👍 re the name, I think Interface Modules is ok to start with. I imagine as you go you may find a better name.

frisoft commented 10 months ago

Thank you, @lukewilliamboswell. Starting from https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/.E2.9C.94.20Most.20basic.20way.20to.20split.20code.20across.20files/near/407935137

I was thinking it would be good to have 2 modules in the example to show the following:

Hope this doesn't make it too complex.

WDYT?

Anton-4 commented 10 months ago

I'd really like to have a minimal complexity example with one app module and one interface module. Perhaps the interface module can just expose something like:

hello : Str
hello = "Hello from interface!"

After we have the minimal example, we could do another one that uses e.g. multiple interfaces grouped in a folder, some exposed and some private functions, a simple opaque type...

frisoft commented 10 months ago

It makes sense. Thank you, @Anton-4. I'll create a PR for it.

frisoft commented 10 months ago

The PR is ready: https://github.com/roc-lang/examples/pull/133 Could you please review it?