So let me just tell what the algorithm is, for people who do not speak haskell.
the second line says
/= is unequal.
y modulo 4 = 0 OR y modulo 100 /= 0 AND y mod 400 = 0
Yes this is boolean algebra.
Fyi I have found the bug, I just thought this might be an interesting exercise.
I will probably update this later, or write a piece on what the bug is,
but that might not be a long article.
Okay the bug is with the order of the logical operators, the right way to do it would be to have not OR first, rather switch the logical operators.
The way this is written in haskell it evaluates lazy and since true OR false is always true this is just a bug.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit