https://hexdocs.pm/elixir/Kernel.html
- === (strict)
- !== (strict)
- == (relaxed)
- !=
- &&
- ||
- !
- >, >=, <, <=
- +, -, *, /, div, rem
- <> (binary concat)
- ++ (list concat)
- -- (list diff)
- 1 (integer)
- 0x1F (integer)
- 1.0 (float)
- true (boolean)
- :foo (atom)
- {1, 2} (tple)
- [1, 2, 3] (list)
- [1 | [2, 3]]
- [a: 1, b: 2] (keyword list)
- [65, 66] or 'AB' (integer list)
- << 65, 66 >> or "AB" (binary string)
- 1..9 (range)
- fn params [guard] -> body end
- function do params [guard] -> body end
- func.() (calling a anonymous function from a variable)
- &(&1, &2) (closure shortcut)
- def name(params) [guard] do expression end
- def name(params) [guard], do: expression
- parameter \\ 42 (default parameter)
- defp ... (private function)
- &module.function/arity
- defmodule ...
- require ...
- use ...
- import Module, only: foo, except: bar
- alias Module, as: M
- :erlang.function() (calling a erlang function)
- when [guard] (pattern matching guard)
- lc x inlist list, y inbits binary, x < y, do: ...
- bc ... inbits ..., guard, do: ...
- something, do: ...
- else, rescue, try, ensure
- a |> b() (pipeline operator)
- if expr do ... else ... end
- condition do matcher -> expr end
- case expr do matcher -> expr end
- %r{pattern]opts (regex)
- %type{content} (sigil)
- pid <- message (Sending message)
- receive do matcher -> expression after 42 -> expression end
- _MODULE_
- _FILE_
- _DIR_
- _ENV_
- _CALLER_
-
^ : Use the pin operator ^ when you want to pattern match against an existing variable’s value rather than rebinding the variable
-
%{} : map
-
#{} in string : run
-
fun! : a function with error message
-
fun? : a boolean function
-
_ : default case
-
_foo : a variable not used
-
@proper : module attributes
-
| : %{recipe | salt: "2tsp"}
-
? : return codepoint https://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html