Mune v0.2.0 Mune View Source

A collection of useful functions that aren’t found in Enum, but are cumbersome or inconvenient to write your own optimized version of.

Link to this section Summary

Functions

Flatten the enum and reverse all elements, applying mapper to each element

Flatten the enum and reverse all elements

Reverse the enum, applying mapper to each element

Link to this section Types

Link to this section Functions

Link to this function flat_map_reverse(enum, mapper) View Source
flat_map_reverse(enum(), (term() -> var)) :: [var] when var: term()

Flatten the enum and reverse all elements, applying mapper to each element.

iex> Mune.flat_map_reverse([[1, 2], [3, 4], [5, 6]], &Kernel.*(&1, 2))
[12, 10, 8, 6, 4, 2]
Link to this function flatten_reverse(enum) View Source
flatten_reverse(enum()) :: list()

Flatten the enum and reverse all elements.

iex> Mune.flatten_reverse([[1, 2], [3, 4], [5, 6]])
[6, 5, 4, 3, 2, 1]
Link to this function map_reverse(enum, mapper) View Source
map_reverse(enum(), (term() -> var)) :: [var] when var: term()

Reverse the enum, applying mapper to each element

iex> Mune.map_reverse([1, 2, 3, 4, 5, 6], &Kernel.*(&1, 2))
[12, 10, 8, 6, 4, 2]