Just did day 10. Actually used a tag for once. Overall was quite straightforward: https://github.com/bhansconnect/roc-aoc-2021/blob/trunk/day10/part2.roc
In the last 2 problems, I defined a crash helper for simplicity. probably could be written better:
crash : a -> a
crash = \a -> crashInternal (0 - 1) a
crashInternal : U8, a -> a
crashInternal = \_, a -> a
Also, I feel the more pipelining I do, the less backpassing I do. I guess it is backpassing for tasks and pipelining for data manipulation.
you could make crash simpler as just
crash : {} -> a
and leave the body unimplemented
or if you want a body (for some reason):
crash : {} -> *
crash = \{} -> if 0u8 - 1 > 0 then crash {} else crash {}
Without a body wouldn't roc check fail?
And roc dev
no
I am very confused... Why is an undefined function with only a prototype not a warning?
I believe the idea is to let you sketch out a design for a program and get parts of it working. The undefined function bodies get replaced with roc_panic
I think
yeah, although we should probably give a reminder somehow
maybe a little note at the end like: "these functions don't have implementations yet: Foo.bar
, Baz.blah
, ..."
sure, but roc check
is supposed to fail CI on warnings or errors. I think not defining a function is something worth failing CI over.
Good point!
https://github.com/ghigt/advent-of-code/tree/main/roc/day-10
An easy one (or I'm better than before :sweat_smile:)
Looks like challenge motivation has been lost, I will probably continue without notify. It has been very entertaining and instructive to do it, lot of progress done. My brain is now directly thinking in Roc instead of Go or JS. Looking forward for easier debug and editor type help for AoC 2022 :innocent:
Yeah, we are apparently like regular advent if code people. Day ten is a far way to make it.
Looking forward for easier debug and editor type help for AoC 2022 :innocent:
editor type help will unfortunately not be ready for AoC 2022, we had this working for small programs but we have a big rewrite planned of an important part of the editor. So it does not make sense to try to expand type help before that because we'd have to throw a lot of it out.
Last updated: Jul 06 2025 at 12:14 UTC