Avatar

kintrix

kintrix@linux.community
Joined
0 posts • 22 comments
Direct message

Don’t know if it’s succesful, but definitely just straight up stupid.

The are many places where it’s not even allowed because it does not meet the local safety and protection standards. It’s a fundamentally unsafe design, especially for the people outside of it. It should not be allowed on the roads, and the EU agrees with this.

Even if it was allowed within the EU, you would need a special driver’s licence for it.

permalink
report
parent
reply

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.

permalink
report
parent
reply

Of course it’s point-free

permalink
report
parent
reply

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

permalink
report
parent
reply

Nix, because I hate myself. No, it is very much not made for this purpose. But it’s possible to use if for this.

permalink
report
reply

<$> is just fmap as an infix operator.

>>> fmap (+1) [1,2,3]
[2,3,4]
>>> (+1) <\$> [1,2,3]
[2,3,4]
permalink
report
parent
reply

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

permalink
report
parent
reply

https://adventofcode.com/

An advent calendar of coding puzzles. Dec 1-25 you get a new puzzle every day

permalink
report
parent
reply

I definitely am: https://git.sr.ht/~kintrix/aoc2024

(The README is wrong, just copied it over from last year)

permalink
report
reply