Sammal v0.1.0 Sammal.Utils View Source

Various utility functions.

Link to this section Summary

Functions

Map a function over each item of a deeply nested list

Link to this section Functions

Link to this function map_deep(list, func) View Source
map_deep(Enumerable.t, (any -> any)) :: list

Map a function over each item of a deeply nested list.

Example

iex> Sammal.Utils.map_deep([1, 2, [3, [4], 5], 6], fn x -> x * 2 end)
[2, 4, [6, [8], 10], 12]