3 ms·
It's a bit tongue-in-cheek to compare this to Edward Kmett's FP Complete articles on Cellular Automata, but they're a really interesting read if you want to get
by tel 13y ago
It's a bit tongue-in-cheek to compare this to Edward Kmett's FP Complete articles on Cellular Automata, but they're a really interesting read if you want to get your feet wet with some advanced Haskell programming
https://www.fpcomplete.com/user/edwardk/cellular-automata https://www.fpcomplete.com/user/edwardk/cellular-automata
The series began as trying to explain the value of the Store Comonad for generalizing the "Cellular Automata are Comonads" notion, but then dipped into how to build resumable folds to implement CRC hashing for pngs.
The final article pulls a really great trick out where by writing down a very general type for cellular automata as comonads it was possible to automatically generate code which generalizes CAs to stranger topologies (like a cylinder).
The final code including the CA code, the strange topologies, the PNG encoder, and a webserver to display the whole thing online is all probably shorter than the Java CA code would have been here.