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
# 166 Concatenate two lists Ø Ø ab = a ++ b
# 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}"
# 54 Compute sum of integers Ø s = Enum.sum(x)
# 118 List to set Ø y = x |> Enum.uniq |> List.to_tuple
# 118 List to set Ø y = MapSet.new(x)
# 71 Echo program implementation Ø Enum.join(args, " ")
# 222 Find the first index of an element ... Ø i = Enum.find_index(items, & &1 == x)
# 93 Pass a runnable procedure as parame... Ø Ø def control(f) do f() end
# 126 Multiple return values Ø Ø def foo, do: {"bar", true}
# 244 Print a map Ø IO.inspect m
# 182 Quine program Ø Ø q=<<"q=~p;:io.format q,[q]">>;:io.format...
# 39 Check if string contains a word Ø ok = String.contains?(s, word)
# 189 Filter and transform list Ø Ø y = x |> Enum.filter(&P/1) |> Enum.map(&...
# 1 Print Hello World Ø IO.puts "Hello World"
# 1 Print Hello World Ø "Hello World" |> IO.puts
# 146 Convert string to floating point nu... Ø f = String.to_float(s)
# 64 Big integer : value 3 power 247 Ø Ø x = :math.pow(3, 247)
# 9 Create a Binary Tree data structure Ø Ø defmodule BinaryTree do defstruct data:...
# 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...
# 11 Pick a random element from a list Ø Enum.random(x)
# 44 Insert element in list Ø List.insert_at(s, i, x)
# 56 Launch 1000 parallel tasks and wait... Ø # 1 f = &(IO.puts(&1)) # 2 printTimes ...
# 250 Pick a random value from a map Ø Ø def main(m) do m |> Map.values() |...
# 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...
# 114 Test deep equality Ø b = x == y
# 119 Deduplicate list Ø Enum.uniq(x)
# 35 First-class function : compose Ø Ø def compose(f, g) do fn a -> g.(f....