A.Vector.sort_by

You're seeing just the function sort_by, go back to A.Vector module for more information.
Link to this function

sort_by(vector, mapper, sorter \\ &<=/2)

View Source

Specs

sort_by(
  t(val),
  (val -> mapped_val),
  (val, val -> boolean()) | :asc | :desc | module() | {:asc | :desc, module()}
) :: t(val)
when val: value(), mapped_val: value()

Sorts the vector in the same way as Enum.sort_by/3.

See Enum.sort_by/3 documentation for detailled usage.

Examples

iex> vector = A.Vector.new(["some", "kind", "of", "monster"])
iex> A.Vector.sort_by(vector, &byte_size/1)
vec(["of", "some", "kind", "monster"])
iex> A.Vector.sort_by(vector, &{byte_size(&1), String.first(&1)})
vec(["of", "kind", "some", "monster"])