iex> map = %{a: 1, b: 2} %{a: 1, b: 2} iex> map[:a] 1 iex> %{map | a: 3} %{a: 3, b: 2}
Defining it in the Elixir REPL:
iex> defmodule User do ...> defstruct name: "John", age: 27 ...> end iex> %User{} %User{age: 27, name: "John"} iex> %User{name: "Jane"} %User{age: 27, name: "Jane"}