DarkMatter.PrefixLists (DarkMatter v1.1.4) View Source

Utils for working with prefix lists

Link to this section Summary

Functions

Expanding prefix lists into a flattened concat representation.

Link to this section Types

Link to this type

atom_or_improper_prefix_list()

View Source

Specs

atom_or_improper_prefix_list() ::
  atom()
  | {atom(), atom_or_improper_prefix_list()}
  | [atom_or_improper_prefix_list()]
Link to this type

expanded_prefix_list()

View Source

Specs

expanded_prefix_list() :: [atom()]

Link to this section Functions

Specs

Expanding prefix lists into a flattened concat representation.

Examples

iex> expand([]) []

iex> expand(:atom) [:atom]

iex> expand(keyword: :list) [:keyword_list]

iex> expand(nested: [[[[:list_of_lists]]]]) [:nested_list_of_lists]

iex> expand(a: [very: [nested: :list]]) [:a_very_nested_list]

iex> expand(two: [very: [nested: [:compound_atom, and: [nested: :list]]]]) [:two_very_nested_compound_atom, :two_very_nested_and_nested_list]

iex> expand(three: [very: [nested: [:compound_atom, [:list_atom], and: [nested: :list]]]]) [ :three_very_nested_compound_atom, :three_very_nested_list_atom, :three_very_nested_and_nested_list ]