4 ms·
Monoids are cool. It took me a long time to actually discover monoids during coding. It finally clicked when I realized the QuadBitboard I wrote for a chess m
by mlang23 5y ago
Monoids are cool. It took me a long time to actually discover monoids during coding. It finally clicked when I realized the QuadBitboard I wrote for a chess move generator is actually a monoid. Empty board is the neutral element, and xor of all 4 bitboards is the operation.
https://github.com/mlang/chessIO/blob/master/src/Game/Chess/Internal/QuadBitboard.hs https://github.com/mlang/chessIO/blob/master/src/Game/Chess/...
- bweitzman 5y agoWhat does xoring mean for combining two boards that have pieces in the same position? Is there a use for such an operation?