   end
 
   # Filter out `positions` and return ones should be created (i.e. have 3 living neighbors).
+  @spec get_positions_to_create([position]) :: [position]
   defp get_positions_to_create(positions) do
     filter(positions, &(count_living_neighbors(&1) == 3))
   end
 
   # Get the neighbors of `position`, filter out living neighbors, and return the count.
+  @spec count_living_neighbors(position) :: integer
   defp count_living_neighbors(position) do
     position
     |> get_neighboring_positions

  # Get the living neighbors of `position`.  If there are exactly 2 or 3, this `position`
  # lives, otherwise it will be destroyed.
  # Returns itself if it should be destroyed, otherwise returns an empty list.
  defp to_destroy(position) do
    position
    |> count_living_neighbors


  # Get the neighboring positions of `position`, filter out the dead neighbors,
  # then get the cell positions which should be created and return them.
  @spec to_create(position) :: [position]
  defp to_create(position) do
    position
    |> get_neighboring_positions
