Code for the 1D game of life using comonads