Just wanted to share something I think is pretty cool, and think it's one of the best examples I've contributed to so far, and only possible thanks to @JanCVanB and his JanCVanB/roc-random library.
Just added roc-lang/examples#20 which shows how to generate Random Numbers using a URL build of the package, and the basic-cli platform. I also made a Github Pages link so you can see the example pre-merge.
super cool! :smiley:
I think it would also be cool to show an example with backpassing
where you build up a generator using an equivalent of https://package.elm-lang.org/packages/elm/random/1.0.0/Random#andThen
(rather than passing the seed around)
There is a next
function which does that I think. I'll play with it some more and see if I can make a good example that shows a few different methods. I'm also considering dropping the basic-cli part, and just make this an interface and use tests to show the results. This might make it easier to combine multiple different methids, and also reduces that dependency.
Wow, I love seeing this (new to me) roc-lang/examples repo, and I'm proud to see my algorithm put to good use! Thank you, @Luke Boswell :D
@Luke Boswell It looks like Roc has a (new to me) remote package sourcing feature - should I/we make a new release on my repo to support this forkless?
I'm also happy to add you/anyone as a collaborator on the repo if we want to centralize work
Ooh, nvm, now I see 1 new issue and 1 new PR on the repo - woohoo!
Last updated: Jul 05 2025 at 12:14 UTC