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
# 27 Create a 3-dimensional array Ø Ø def main(m, n, p) do if m == 0 or ...
# 31 Recursive factorial (simple) Ø Ø defmodule Factorial do def f(0), do: 1...
# 81 Round floating point number to inte... Ø ✓ y = Kernel.round x
# 330 Map to list Ø ✓ a = Map.values(m)
# 113 Iterate over map entries, ordered b... Ø ✓ mymap |> Map.to_list |> Enum.sort(fn (...
# 57 Filter list Ø ✓ y = Enum.filter(x, p)
# 57 Filter list Ø Ø y = for item <- x, p.(item), do: item
# 79 Convert integer to floating point n... ✓ Ø y = x / 1
# 136 Remove all occurrences of a value ... Ø ✓ Enum.filter(items, fn v -> v != x end)
# 91 Load JSON file into object Ø Ø defmodule JsonTest do def get_json(fil...
# 54 Compute sum of integers Ø ✓ s = Enum.sum(x)
# 4 Create a function Ø Ø @spec square(integer) :: integer def squ...
# 23 Convert real number to string with ... Ø ✓ s = Float.to_string(x, decimals: 2)
# 64 Big integer : value 3 power 247 Ø Ø x = :math.pow(3, 247)
# 76 Binary digits from an integer Ø ✓ s = Integer.to_string(x, 2)
# 76 Binary digits from an integer Ø Ø Integer.digits(x, 2) |> Enum.join("")
# 45 Pause execution for 5 seconds Ø ✓ Process.sleep(5000)
# 75 Compute LCM Ø Ø defmodule BasicMath do def gcd(a, 0), d...
# 140 Delete map entry Ø ✓ m = Map.delete(m, k)
# 230 Timeout Ø Ø def main(p) do p |> Task.async() |...
# 133 Case-insensitive string contains Ø ✓ ok = s =~ ~r/#{word}/i
# 50 Make an infinite loop Ø Ø defmodule Looping do def infinite do ...
# 166 Concatenate two lists Ø Ø ab = a ++ b
# 65 Format decimal number Ø ✓ s = "#{Float.round(x * 100, 1)}%"
# 3 Create a procedure Ø Ø def finish(name) do IO.puts "My job he...
# 28 Sort by a property Ø ✓ Enum.sort_by(items, &(&1.p))
# 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...