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
# 96 Check string prefix Ø String.starts_with?(s,prefix)
# 237 Xor integers Ø c = a ^^^ b
# 78 "do while" loop Ø Ø def main(condition) do case condition ...
# 230 Timeout Ø Ø def main(p) do p |> Task.async() |...
# 49 Split a space-separated string Ø chunks = String.split(s)
# 114 Test deep equality Ø b = x == y
# 56 Launch 1000 parallel tasks and wait... Ø # 1 f = &(IO.puts(&1)) # 2 printTimes ...
# 14 Pick uniformly a random floating po... Ø a + :rand.uniform() * (b-a)
# 14 Pick uniformly a random floating po... Ø defmodule MyRandomPicker do def pick(a...
# 38 Extract a substring Ø t = String.slice(s, i..j-1)
# 87 Stop program Ø System.halt()
# 63 Replace fragment of a string Ø x2 = String.replace(x, y, z)
# 50 Make an infinite loop Ø Ø defmodule Looping do def infinite do ...
# 157 Declare constant string Ø Ø planet = "Earth"
# 3 Create a procedure Ø Ø def finish(name) do IO.puts "My job he...
# 189 Filter and transform list Ø Ø y = x |> Enum.filter(&P/1) |> Enum.map(&...
# 126 Multiple return values Ø Ø def foo, do: {"bar", true}
# 184 Tomorrow Ø Ø def main() do Date.utc_today() |> Da...
# 1 Print Hello World Ø IO.puts "Hello World"
# 1 Print Hello World Ø "Hello World" |> IO.puts
# 118 List to set Ø y = x |> Enum.uniq |> List.to_tuple
# 118 List to set Ø y = MapSet.new(x)
# 57 Filter list Ø y = Enum.filter(x, p)
# 57 Filter list Ø Ø y = for item <- x, p.(item), do: item
# 97 Check string suffix Ø b = String.ends_with?(s, suffix)
# 79 Convert integer to floating point n... Ø y = x / 1
# 54 Compute sum of integers Ø s = Enum.sum(x)
# 25 Send a value to another thread Ø pid = spawn fn -> receive do {:hel...
# 35 First-class function : compose Ø Ø def compose(f, g) do fn a -> g.(f....