The pipe operator |>
in Elixir is very powerful.
It passes the result of the left side in as the first parameter of the right.
They even work with case statements:
1
|> case do
{:ok, body} -> body
{:error, reason} -> {:error, reason}
x -> x
end