wintermeyer / elixir-phoenix-ash

An Elixir, Phoenix and Ash Beginner's Guide
https://elixir-phoenix-ash.com
Other
10 stars 7 forks source link

Move modules / functions section in elixir-introduction to before anonymous functions section #16

Closed riverrun closed 4 years ago

riverrun commented 4 years ago

I think we can move the Modules and Functions section to an earlier and more prominent position (before the Anonymous Functions section) in the elixir-introduction. This is because most of the functions that developers will read and write are regular functions (within modules) and it makes it easier to look at anonymous functions (and the capture operator) in the way they are most often used (as arguments in higher-order functions) if we look at them after covering regular functions.

My proposal is to move the Modules and Functions section to after the Strings section and to move the Anonymous Functions and Capture Operator sections to subsections before the Hierarchical Modules section. Also, I want to add more examples using higher-order functions to the Anonymous Functions and Capture Operator sections.

riverrun commented 4 years ago

If we move the Modules and Functions section, I think we should just include an introduction to modules and the Private Functions and Function Arity subsections. We can cover the information about hierarchical modules and import, alias and use in a later part of the same page (maybe in a More about Modules section).

We could also move the Modules and Functions section to before the Atoms section, instead of after the Strings section.

Also, we will need to move the information about anonymous functions and the capture operator to after the Lists and Tuples section because the higher-order functions we will want to use will be operating on lists.