My guess is because a linter and/or HLS was suggesting it. I know HLS used to suggest making your fields strict in almost all cases. In this case I have a hunch that it slightly cuts down on memory usage because we use almost all Muls either way. So it does not need to keep the string it is parsed from in memory as part of the thunk.
But it probably makes a small/negligible difference here.
True. I love how AoC is a hotbed for creative and/or insane ways of solving coding problems.
If you wanna check out how it goes in Nix: git.sr.ht/~kintrix/aoc2024
<$> is just fmap as an infix operator.
You can also use the pipe operators; but they are still experimental features.
foo (bar (baz x)) = x |> baz |> bar |> foo = foo <| bar <| baz <| x`
An advent calendar of coding puzzles. Dec 1-25 you get a new puzzle every day