View Source AbsintheUtils.Helpers.Sort (absinthe_utils v0.0.1-development)

Link to this section Summary

Functions

Given an enumerable, returns a map of each element to the position in the original enumerable (zero based).

Link to this section Functions

Link to this function

map_enum_to_index(enumerable)

View Source
@spec map_enum_to_index([any()]) :: map()

Given an enumerable, returns a map of each element to the position in the original enumerable (zero based).

examples

Examples

iex> Sort.map_enum_to_index([:a, :b, :c])
%{a: 0, b: 1, c: 2}
Link to this function

sort_alike(unsorted_enumerable, sorted_enumerable, unsorted_enumerable_mapper \\ & &1, sorted_enumerable_mapper \\ & &1)

View Source