kintrix@linux.communitytoAdvent Of Code@programming.dev•🍷 - 2024 DAY 3 SOLUTIONS -🍷English
3·
22 days agoOf course it’s point-free
Of course it’s point-free
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: https://git.sr.ht/~kintrix/aoc2024
Java
Nix, because I hate myself. No, it is very much not made for this purpose. But it’s possible to use if for this.
<$>
is just fmap
as an infix operator.
>>> fmap (+1) [1,2,3]
[2,3,4]
>>> (+1) <\$> [1,2,3]
[2,3,4]
Halfway competent criminals know how to prevent it. But at the same time, I am simply against any and all non-consensual tracking.
I have a similar stance on this as DRM.
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
Mul
s 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.