Pathex.Combination (Pathex v1.2.0) View Source
Module for combination structures
Link to this section Summary
Types
Plain representation of one path for generating one case(do:)
or one matchable case
Representation of one path combination
Functions
Simply transforms passed path into combination
Transforms combination into list of paths this combination defines
Link to this section Types
Specs
path() :: [{struct_type(), any()}]
Plain representation of one path for generating one case(do:)
or one matchable case
Specs
t() :: [[{struct_type(), Macro.t()}]]
Representation of one path combination
For example:
[
[map: :x, keyword: :x]
[map: :y]
]
Will expand to
case do
%{x: inner} ->
case inner do
%{y: value} -> {:ok, value}
_ -> :error
end
[_ | _] = keyword->
case Keyword.fetch(keyword, :x) do
{:ok, inner} ->
case inner do
%{y: value} -> {:ok, value}
_ -> :error
end
_ ->
:error
end
_ ->
:error
end
Link to this section Functions
Specs
Simply transforms passed path into combination
Specs
Transforms combination into list of paths this combination defines