View Source Moar.Enum (Moar v1.7.0)

Enum-related functions.

Link to this section Summary

Functions

Like Enum.at/2 but raises if index is out of bounds.

Removes nil elements from enum.

Returns the first item of enum, or raises if it is empty.

Sorts enum case-insensitively. Uses Enum.sort_by/3 under the hood.

Sorts enum case-insensitively by mapper function. Uses Enum.sort_by/3 under the hood.

Returns :tid fields from enumerable.

Link to this section Functions

@spec at!(Enum.t(), integer()) :: any()

Like Enum.at/2 but raises if index is out of bounds.

@spec compact(Enum.t()) :: Enum.t()

Removes nil elements from enum.

@spec first!(Enum.t()) :: any()

Returns the first item of enum, or raises if it is empty.

@spec isort(Enum.t()) :: Enum.t()

Sorts enum case-insensitively. Uses Enum.sort_by/3 under the hood.

@spec isort_by(Enum.t(), (any() -> any())) :: Enum.t()

Sorts enum case-insensitively by mapper function. Uses Enum.sort_by/3 under the hood.

@spec tids(Enum.t()) :: list()

Returns :tid fields from enumerable.