|
|
|
|
|
by Mathiciann
1260 days ago
|
|
I suspected my novice-ness could be the reason. Still, I could probably solve them without mutable state but I wasnt satisfied with the readability of my code. For example day 12 day 13 were a mess for me when trying for purely functional. Would love to see your solution for one of these problems! |
|
https://github.com/cronin101/AdventOfCode/blob/master/2022/D...
Day 13 on the other hand is something I'm far less ashamed of and really lets Haskell shine, it basically didn't need any code at all. I just defined how to parse an equivalent data representation, how it was sorted via Eq/Ord typeclass (following the brief), and used `compare` to do the lifting.
https://github.com/cronin101/AdventOfCode/blob/master/2022/D...