# Genetic Algorithms in Elixir: Chapter 2

**URL:** <https://forum.devtalk.com/t/genetic-algorithms-in-elixir-chapter-2/3495>\
**Category:** PragProg Customers\
**Tags:** book-genetic-algorithms-in-elixir, errata\
**Created:** [27 October 2020 21:09 UTC](https://forum.devtalk.com/t/genetic-algorithms-in-elixir-chapter-2/3495 "2020-10-27T21:09:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![srowley](https://forum.devtalk.com/user_avatar/forum.devtalk.com/srowley/32/652_2.png) [@srowley](https://forum.devtalk.com/u/srowley)\
**Post date:** [29 November 2020 14:47 UTC](https://forum.devtalk.com/t/genetic-algorithms-in-elixir-chapter-2/3495/4 "2020-11-29T14:47:19Z")

</div>

I am really enjoying the book (B2) so far.

The version of `evolve/4` on page 27 takes `genotype` as an argument, but it doesn’t seem to need it for anything other than to pass it to itself again recursively. The version on page 28 looks like it was corrected in this regard.

If that isn’t needed, it seems like a slightly prettier way to write `run/3` would be:

```auto
def run(genotype, fitness_function, max_fitness) do
  genotype
  |> initialize() # maybe call this `initialize_population`
  |> evolve(fitness_function, max_fitness)
end

```

An even more pedantic suggestion - use verbs for all the function names in the pipeline, i.e., `mutate` instead of `mutation` and maybe `cross` instead of `crossover`.

---

_[View the full topic](https://forum.devtalk.com/t/genetic-algorithms-in-elixir-chapter-2/3495)._
