Toolbelt v0.1.1 Toolbelt.Enum

Functions closely related to Enum that didn’t make it or didn’t yet make it to the standard library.

Summary

Functions

Performs a classical ormap on the given enumerable

Takes the first element from the enumerable

Transforms the keys of the map-like structure according to the given procedure in the second argument

Iterates over all own keys and nested keys and transforms them according to the given procedure

Transforms the values of the map-like structure according to the given procedure in the second argument

Iterates over all own values and nested values and transforms them according to the given procedure

Deeply merges two maplike structures into one

Performs a classical ormap on the given enumerable

Takes the first element from the enumerable

Functions

andmap(enum, callback)

Performs a classical ormap on the given enumerable.

first(enum)

Takes the first element from the enumerable.

map_keys(maplike, callback)

Transforms the keys of the map-like structure according to the given procedure in the second argument.

map_keys_deep(maplike, callback)

Iterates over all own keys and nested keys and transforms them according to the given procedure.

map_values(maplike, callback)

Transforms the values of the map-like structure according to the given procedure in the second argument.

map_values_deep(maplike, callback)

Iterates over all own values and nested values and transforms them according to the given procedure.

merge_deep(a, b)

Deeply merges two maplike structures into one.

As a matter of convenience, the second argument may be nil, which will cause the function to return the first argument unmodified.

ormap(enum, callback)

Performs a classical ormap on the given enumerable.

rest(enum)

Takes the first element from the enumerable.