# Programming-Idioms

• Or search :

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
# 56 Launch 1000 parallel tasks and wait... # 1 f = &(IO.puts(&1)) # 2 printTimes ...
# 97 Check string suffix String.ends_with?(s, suffix)
# 182 Quine program q=<<"q=~p;:io.format q,[q]">>;:io.format...
# 161 Multiply all the elements of a list elements = Enum.map(elements, &(&1 * c))
# 21 Swap values {a, b} = {b, a}
# 66 Big integer exponentiation z = :math.pow(x, n)
# 157 Declare constant string planet = "Earth"
# 80 Truncate floating point number to i... y = trunc(x)
# 64 Big integer : value 3 power 247 x = :math.pow(3, 247)
# 7 Iterate over list indexes and value... items |> Enum.with_index |> Enum.each(fn...
# 50 Make an infinite loop defmodule Looping do def infinite do ...
# 131 Successive conditions cond do c1 -> f1 c2 -> f2 c3 -> f3...
# 79 Convert integer to floating point n... y = x / 1
# 63 Replace fragment of a string x2 = String.replace(x, y, z)
# 26 Create a 2-dimensional array x = for _ <- 1..m, do: for _ <- 1..n, do...
# 93 Pass a runnable procedure as parame... def control(f) do f() end
# 12 Check if list contains a value Enum.member?(list, x)
# 12 Check if list contains a value x in list
# 30 Parallelize execution of 1000 indep... f = fn x -> x * :rand.uniform() end tas...
# 15 Pick uniformly a random integer in ... :crypto.rand_uniform(a, b)
# 15 Pick uniformly a random integer in ... a - 1 + :rand.uniform(b-a+1)
# 49 Split a space-separated string chunks = String.split(s)
# 54 Compute sum of integers s = Enum.sum(x)
# 99 Format date YYYY-MM-DD x = Date.to_iso8601(d)
# 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...
# 118 List to set y = x |> Enum.uniq |> List.to_tuple
# 118 List to set y = MapSet.new(x)
# 29 Remove item from list, by its index List.delete_at(items, i)