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
# 136 Remove all occurrences of a value ... Ø Enum.filter(items, fn v -> v != x end)
# 83 Regex with character repetition Ø r = Regex.compile!("htt+p")
# 203 Calculate mean and standard deviati... Ø defmodule SD do import Enum, only: [ma...
# 99 Format date YYYY-MM-DD Ø x = Date.to_iso8601(d)
# 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}"
# 155 Delete file Ø File.rm(filepath)
# 39 Check if string contains a word Ø ok = String.contains?(s, word)
# 8 Create a map (associative array) Ø x = %{"one" => 1, "two" => 2}
# 8 Create a map (associative array) Ø Ø x = %{one: 1, two: 2}
# 75 Compute LCM Ø Ø defmodule BasicMath do def gcd(a, 0), d...
# 35 First-class function : compose Ø Ø def compose(f, g) do fn a -> g.(f....
# 79 Convert integer to floating point n... Ø y = x / 1
# 23 Convert real number to string with ... Ø s = Float.to_string(x, decimals: 2)
# 56 Launch 1000 parallel tasks and wait... Ø # 1 f = &(IO.puts(&1)) # 2 printTimes ...
# 161 Multiply all the elements of a list Ø elements = Enum.map(elements, &(&1 * c))
# 94 Print the type of a variable Ø Ø [{_, type} | _] = IEx.Info.info(x) type
# 95 Get file size Ø Ø def main(path) do _x = path |>...
# 22 Convert string to integer Ø i = String.to_integer(s)
# 82 Count substring occurrences Ø s |> String.split(t) |> Enum.drop(1) |> ...
# 295 String to Enum Ø Ø def try_str_to_enum(t, string), do: t[st...
# 87 Stop program Ø System.halt()
# 135 Remove item from list, by its value Ø List.delete(items, x)
# 272 Play FizzBuzz Ø Ø defmodule FizzBuzz do def run do f...
# 116 Remove occurrences of word from str... Ø s2 = String.replace(s1, w, "")
# 57 Filter list Ø y = Enum.filter(x, p)
# 57 Filter list Ø Ø y = for item <- x, p.(item), do: item
# 237 Xor integers Ø c = a ^^^ b