A demo Elixir program that sums over a list. Part of Rocket Seat Ignite, an online Elixir and Phoenix bootcamp.
$ mix new project_name
$ mix compile
$ mix test
$ mix format
$ iex -S mix
> SumOverList.call([1, 2, 34, 5])
42
> Factorial.compute(6)
720
> Enum.map(%{a: 1, b: 2}, fn x -> x end)
[a: 1, b: 2]
> Enum.map(%{a: 1, b: 2}, fn {key, value} -> {key, value} end)
[a: 1, b: 2]
> Enum.map(%{a: 1, b: 2}, fn {_key, value} -> value end)
[1, 2]
-
https://elixir-examples.github.io/examples/get-type-of-variable
-
https://github.com/elixir-examples/elixir-examples.github.io
-
https://kapeli.com/cheat_sheets/Elixir_Guards.docset/Contents/Resources/Documents/index
-
https://marketplace.visualstudio.com/items?itemName=iampeterbanjo.elixirlinter
-
https://shulhi.com/2016/11/16/piping-to-second-argument-in-elixir/
-
https://stackoverflow.com/questions/36730122/elixir-multiple-arguments-with-the-pipe-operator
-
https://blog.appsignal.com/2019/03/19/elixir-alchemy-recursion.html
-
https://culttt.com/2016/06/06/understanding-recursion-tail-call-optimisation-elixir/