Orasund/elm-cellautomata/3.1.1

CellAutomata.Rule

module for building rules.

type alias Rule direction state =
{ from : Maybe state
, neighborhood : Dict direction state -> Bool
, to : Maybe state
}

A Rule specifies how a given cell should change based on its neighbors.

fromNothing : Rule direction state

Only empty cells should be effected.

from : state -> Rule direction state

Which cell is effected?

(Dict direction state -> Bool)
-> Rule direction state
-> Rule direction state

How do the neighbors look like?

to : state -> Rule direction state -> Rule direction state

What should the cell turn into?

toNothing : Rule direction state -> Rule direction state

The content of the cell will be removed