Stream: roctoberfest

Topic: Day 4


view this post on Zulip Brendan Hansknecht (Oct 03 2022 at 18:35):

I just implemented day 4 in what feels like a slightly silly way. That being said, it was quite fun to implement this way even if it is doing work it really shouldn't be. The solution felt nice to write.

code: https://github.com/bhansconnect/roc-aoc-2021/blob/trunk/day4/part1.roc

view this post on Zulip Brendan Hansknecht (Oct 03 2022 at 18:36):

I feel like I am really starting to fully grok heavily pipelined solutions.

view this post on Zulip Shritesh Bhattarai (Oct 03 2022 at 20:35):

Day 4 Part 1: Backpass all the things. https://github.com/shritesh/advent/blob/main/2021/4.roc. Sets in the stdlib made this a breeze

view this post on Zulip Shritesh Bhattarai (Oct 03 2022 at 22:52):

Part 2 is just part 1 flipped inside out: https://github.com/shritesh/advent/blob/main/2021/4.roc

I've tried my best to error instead of default values, which kinda feel icky. Also, loving that I don't have to write any type annotations at all. Hopefully the editor does this automatically in the future.

view this post on Zulip Ghislain (Oct 04 2022 at 20:07):

I didn't think I would make it to the end, but finally after a surprising "segfault" it all works!
https://github.com/ghigt/advent-of-code/tree/main/roc/day-4
I've been a bit frustrated to unwrap values from inside a Tag. I don't know how to do it without a when.


Last updated: Jul 06 2025 at 12:14 UTC