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 |
# 200 | Return hypotenuse | Ø | Ø | def sq(x) do x*x end def hypo(a,b) do... |
# 43 | Break outer loop | Ø | Ø | def main([]), do: nil def main([row ... |
# 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 |
# 71 | Echo program implementation | Ø | ✓ | Enum.join(args, " ") |
# 11 | Pick a random element from a list | Ø | ✓ | Enum.random(x) |
# 147 | Remove all non-ASCII characters | Ø | ✓ | t = s |> String.to_charlist() |>... |
# 147 | Remove all non-ASCII characters | Ø | Ø | t = for <<c <- s>>, c in 0..127, into: "... |
# 184 | Tomorrow | Ø | Ø | def main() do Date.utc_today() |> Da... |
# 74 | Compute GCD | Ø | Ø | defmodule Gcd do def gcd(x, 0), do: x ... |
# 74 | Compute GCD | Ø | ✓ | x = Integer.gcd(a, b) |
# 50 | Make an infinite loop | Ø | Ø | defmodule Looping do def infinite do ... |
# 250 | Pick a random value from a map | Ø | Ø | def main(m) do m |> Map.values() |... |
# 252 | Conditional assignment | Ø | ✓ | x = if condition(), do: "a", else: "b" |
# 100 | Sort by a comparator | Ø | ✓ | Enum.sort(items, c) |
# 66 | Big integer exponentiation | Ø | Ø | z = :math.pow(x, n) |
# 91 | Load JSON file into object | Ø | Ø | defmodule JsonTest do def get_json(fil... |
# 230 | Timeout | Ø | Ø | def main(p) do p |> Task.async() |... |
# 135 | Remove item from list, by its value | Ø | ✓ | List.delete(items, x) |
# 5 | Create a 2D Point data structure | Ø | ✓ | p = [ x: 1.122, y: 7.45 ] |
# 5 | Create a 2D Point data structure | Ø | Ø | {x, y} defmodule Point do defstruct x:... |
# 131 | Successive conditions | Ø | Ø | cond do c1 -> f1 c2 -> f2 c3 -> f3... |
# 45 | Pause execution for 5 seconds | Ø | ✓ | Process.sleep(5000) |
# 161 | Multiply all the elements of a list | ✓ | Ø | elements = Enum.map(elements, &(&1 * c)) |
# 140 | Delete map entry | Ø | ✓ | m = Map.delete(m, k) |
# 22 | Convert string to integer | Ø | ✓ | i = String.to_integer(s) |
# 273 | Check if folder is empty | Ø | Ø | def main(p) do b = File.ls!(p) == [] e... |