This repository contains source code related to my own personal learning of the Elixir programming language and the Phoenix framework.
- cards: Introductory project to elixir developed while taking the Udemy course "The complete Elixir and Phoenix bootcamp and tutorial" by Stephen Grider.
Creates a new keyword list and access a property
iex> colors = [{:primary, "red"}, {:secondary, "blue"}]
iex> colors[:secondary]
"blue"
Creating a map and accessing its values directly
iex> colors = %{ primary: "red", secondary: "blue" }
iex> colors.secondary
"blue"
Using pattern matching with a map
iex> colors = %{ primary: "red", secondary: "blue" }
iex> %{secondary: secondary_color} = colors
iex> secondary_color
"blue"
Update a value in a map using a function of the Map type
iex> colors = %{ primary: "red", secondary: "blue" }
iex> Map.put(colors, :primary, "yellow")
%{primary: "yellow", secondary: "blue"}
Update a value in a map using the pipe |
symbol
iex> colors = %{ primary: "red", secondary: "blue" }
iex> %{ colors | primary: "yellow" }
%{primary: "yellow", secondary: "blue"}
Put a new value to an existing map
iex> colors = %{ primary: "red" }
iex> Map.put_new(colors, :secondary, "blue")
%{primary: "red", secondary: "blue"}
Run interactive shell
$ iex -S mix
Get dependencies
$ mix deps.get
Generate documentation
$ mix docs
Execute tests
$ mix test