Bundlex v0.1.1 Bundlex.Helper.EnumHelper View Source
Module containing helper functions for manipulating enums.
Link to this section Summary
Functions
Implementation of Enum.unzip/1 for more-than-two-element tuples. Accepts arguments
Same as above, returns plain result, throws match error if something goes wrong
Works the same way as Enum.zip/1, but does not cut off remaining values
Link to this section Functions
Link to this function
unzip(list, tuple_size)
View Source
unzip([] | [...], pos_integer()) :: {:ok, Tuple.t()} | {:error, any()}
Implementation of Enum.unzip/1 for more-than-two-element tuples. Accepts arguments:
List to be unzipped,
Size of each tuple in this list.
Returns {:ok, result} if there is no error.
Returns {:error, reason} if encounters a tuple of size different from tuple_size argument.
As such function is planned to be supplied in Enum module, it should replace this one once it happens.
Link to this function
unzip!(list, tuple_size)
View Source
unzip!([] | [...], pos_integer()) :: Tuple.t()
Same as above, returns plain result, throws match error if something goes wrong.