Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Enum Functions

3_enum_functions.livemd

Enum Functions

import IEx.Helpers
require Integer

Functions

h(Enum)
exports(Enum)
Enum.__info__(:functions)
:functions
|> Enum.__info__()
|> Enum.map(fn {name, arity} ->
  "#{name}/#{arity}"
end)
|> Enum.each(&IO.puts/1)

# |> Enum.each(fn item -> IO.puts(item) end)
h(Enum.any?())
1..20 |> Enum.any?(&Integer.is_even/1)

1..20 |> Enum.all?(&Integer.is_even/1)
%{x: 1, y: 2} |> Enum.empty?()
901..1000 |> Enum.filter(&(&1 > 990))
901..1000 |> Enum.find(&(&1 > 990))
1..1000 |> Enum.reject(&(&1 > 9))
[1, 1, 1, 1, 12, 2, 2, 2, 5, 5, 5, 5] |> Enum.dedup()
1..1000 |> Enum.shuffle() |> Enum.take(20)
1..1000 |> Enum.shuffle() |> Enum.take_while(fn x -> x > 10 end)
1..1000 |> Enum.shuffle() |> Enum.drop(15) |> Enum.count()
1..1000 |> Enum.shuffle() |> Enum.drop_while(fn x -> x > 500 end)
Enum.zip(1..10, 2..20)
Enum.zip(Enum.shuffle(21..30), 1..10)
Enum.with_index(Enum.shuffle(21..30))