Toolbelt v0.3.1 Toolbelt.Enum

Functions closely related to Enum that didn’t make it or didn’t yet make it to the standard library.

Summary

Functions

Reduces the given enumerable using an and-operation

Reduces the given enumerable using an or-operation

Takes the first element from the enumerable

Takes the first element from the enumerable

Functions

all?(xA)

See Enum.all?/1.

all?(xA, xB)

See Enum.all?/2.

andmap(enum, callback)

Reduces the given enumerable using an and-operation.

def MyModule do

  require Integer

  def test_someting do
    Enum.ormap([2, 3, 4, 6], &Integer.is_odd?) # false
    Enum.ormap([2, 3, 4, 6], &Integer.is_odd?) # true
  end
end
any?(xA)

See Enum.any?/1.

any?(xA, xB)

See Enum.any?/2.

at(xA, xB)

See Enum.at/2.

at(xA, xB, xC)

See Enum.at/3.

chunk(xA, xB)

See Enum.chunk/2.

chunk(xA, xB, xC)

See Enum.chunk/3.

chunk(xA, xB, xC, xD)

See Enum.chunk/4.

chunk_by(xA, xB)

See Enum.chunk_by/2.

chunk_every(xA, xB)

See Enum.chunk_every/2.

chunk_every(xA, xB, xC)

See Enum.chunk_every/3.

chunk_every(xA, xB, xC, xD)

See Enum.chunk_every/4.

chunk_while(xA, xB, xC, xD)

See Enum.chunk_while/4.

concat(xA)

See Enum.concat/1.

concat(xA, xB)

See Enum.concat/2.

count(xA)

See Enum.count/1.

count(xA, xB)

See Enum.count/2.

dedup(xA)

See Enum.dedup/1.

dedup_by(xA, xB)

See Enum.dedup_by/2.

drop(xA, xB)

See Enum.drop/2.

drop_every(xA, xB)

See Enum.drop_every/2.

drop_while(xA, xB)

See Enum.drop_while/2.

each(xA, xB)

See Enum.each/2.

empty?(xA)

See Enum.empty?/1.

fetch(xA, xB)

See Enum.fetch/2.

fetch!(xA, xB)

See Enum.fetch!/2.

filter(xA, xB)

See Enum.filter/2.

filter_map(xA, xB, xC)

See Enum.filter_map/3.

find(xA, xB)

See Enum.find/2.

find(xA, xB, xC)

See Enum.find/3.

find_index(xA, xB)

See Enum.find_index/2.

find_value(xA, xB)

See Enum.find_value/2.

find_value(xA, xB, xC)

See Enum.find_value/3.

flat_map(xA, xB)

See Enum.flat_map/2.

flat_map_reduce(xA, xB, xC)

See Enum.flat_map_reduce/3.

group_by(xA, xB)

See Enum.group_by/2.

group_by(xA, xB, xC)

See Enum.group_by/3.

intersperse(xA, xB)

See Enum.intersperse/2.

into(xA, xB)

See Enum.into/2.

into(xA, xB, xC)

See Enum.into/3.

join(xA)

See Enum.join/1.

join(xA, xB)

See Enum.join/2.

map(xA, xB)

See Enum.map/2.

map_every(xA, xB, xC)

See Enum.map_every/3.

map_join(xA, xB)

See Enum.map_join/2.

map_join(xA, xB, xC)

See Enum.map_join/3.

map_reduce(xA, xB, xC)

See Enum.map_reduce/3.

max(xA)

See Enum.max/1.

max(xA, xB)

See Enum.max/2.

max_by(xA, xB)

See Enum.max_by/2.

max_by(xA, xB, xC)

See Enum.max_by/3.

member?(xA, xB)

See Enum.member?/2.

min(xA)

See Enum.min/1.

min(xA, xB)

See Enum.min/2.

min_by(xA, xB)

See Enum.min_by/2.

min_by(xA, xB, xC)

See Enum.min_by/3.

min_max(xA)

See Enum.min_max/1.

min_max(xA, xB)

See Enum.min_max/2.

min_max_by(xA, xB)

See Enum.min_max_by/2.

min_max_by(xA, xB, xC)

See Enum.min_max_by/3.

ormap(enum, callback)

Reduces the given enumerable using an or-operation.

def MyModule do

  require Integer

  def test_someting do
    Enum.andmap([2, 3, 4, 6], &Integer.is_even?) # false
    Enum.andmap([2, 2, 4, 6], &Integer.is_even?) # true
  end
end
partition(xA, xB)

See Enum.partition/2.

pop(enum)

Takes the first element from the enumerable.

random(xA)

See Enum.random/1.

reduce(xA, xB)

See Enum.reduce/2.

reduce(xA, xB, xC)

See Enum.reduce/3.

reduce_while(xA, xB, xC)

See Enum.reduce_while/3.

reject(xA, xB)

See Enum.reject/2.

rest(enum)

Takes the first element from the enumerable.

reverse(xA)

See Enum.reverse/1.

reverse(xA, xB)

See Enum.reverse/2.

reverse_slice(xA, xB, xC)

See Enum.reverse_slice/3.

scan(xA, xB)

See Enum.scan/2.

scan(xA, xB, xC)

See Enum.scan/3.

shuffle(xA)

See Enum.shuffle/1.

slice(xA, xB)

See Enum.slice/2.

slice(xA, xB, xC)

See Enum.slice/3.

sort(xA)

See Enum.sort/1.

sort(xA, xB)

See Enum.sort/2.

sort_by(xA, xB)

See Enum.sort_by/2.

sort_by(xA, xB, xC)

See Enum.sort_by/3.

split(xA, xB)

See Enum.split/2.

split_while(xA, xB)

See Enum.split_while/2.

split_with(xA, xB)

See Enum.split_with/2.

sum(xA)

See Enum.sum/1.

take(xA, xB)

See Enum.take/2.

take_every(xA, xB)

See Enum.take_every/2.

take_random(xA, xB)

See Enum.take_random/2.

take_while(xA, xB)

See Enum.take_while/2.

to_list(xA)

See Enum.to_list/1.

uniq(xA)

See Enum.uniq/1.

uniq(xA, xB)

See Enum.uniq/2.

uniq_by(xA, xB)

See Enum.uniq_by/2.

unzip(xA)

See Enum.unzip/1.

with_index(xA)

See Enum.with_index/1.

with_index(xA, xB)

See Enum.with_index/2.

zip(xA)

See Enum.zip/1.

zip(xA, xB)

See Enum.zip/2.