Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

This list shows some idioms having at least : 1 Elixir implementation with some empty fields.

You may click on a missing field and fill the gap.

Demo
URL
Doc
URL
# 28 Sort by a property Ø Enum.sort_by(items, &(&1.p))
# 140 Delete map entry Ø m = Map.delete(m, k)
# 122 Declare an enumeration Ø Ø @suits %{ "SPADES" => 1, "HEARTS" =>...
# 78 "do while" loop Ø Ø def main(condition) do case condition ...
# 39 Check if string contains a word Ø ok = String.contains?(s, word)
# 31 Recursive factorial (simple) Ø Ø defmodule Factorial do def f(0), do: 1...
# 48 Multi-line string literal Ø Ø s = "Spanning string works"
# 48 Multi-line string literal Ø s = """ multiline heredoc """
# 48 Multi-line string literal Ø s = ~S""" This will print multiline and ...
# 252 Conditional assignment Ø x = if condition(), do: "a", else: "b"
# 43 Break outer loop Ø Ø def main([]), do: nil def main([row ...
# 10 Shuffle a list Ø y = Enum.shuffle x
# 55 Convert integer to string s = Integer.to_string(i)
# 55 Convert integer to string Ø s = to_string(i)
# 55 Convert integer to string Ø Ø s = "#{i}"
# 153 Concatenate string with integer Ø t = s <> to_string(i)
# 141 Iterate in sequence over two lists Ø Ø def main(items1, items2) do Enum.each(...
# 141 Iterate in sequence over two lists Ø Ø items1 ++ items2 |> Enum.each(&IO.puts/1...
# 224 Add element to the beginning of the... Ø Ø items2 = [x | items]
# 4 Create a function Ø Ø @spec square(integer) :: integer def squ...
# 22 Convert string to integer Ø i = String.to_integer(s)
# 87 Stop program Ø System.halt()
# 146 Convert string to floating point nu... Ø f = String.to_float(s)
# 38 Extract a substring Ø t = String.slice(s, i..j-1)
# 100 Sort by a comparator Ø Enum.sort(items, c)
# 66 Big integer exponentiation Ø Ø z = :math.pow(x, n)
# 25 Send a value to another thread Ø pid = spawn fn -> receive do {:hel...
# 80 Truncate floating point number to i... Ø y = trunc(x)
# 118 List to set Ø y = x |> Enum.uniq |> List.to_tuple
# 118 List to set Ø y = MapSet.new(x)
# 230 Timeout Ø Ø def main(p) do p |> Task.async() |...