🍵 Matcha - first-class match specifications for Elixir

I have a library called Pathex which does this kind of nesting. But I just was curious if it is possible with match specs.

For multiple arguments I’d prefer to have the same behaviour. For example,

spec1 = spec(do: [head | tail] -> head + tail)
spec2 = spec(do: {left, right} -> left * right)

merge(spec1, spec2)
# Results in
spec(do: [{head_left, head_right} | {tail_left, tail_right}] -> (head_left * head_right) + (tail_left * tail_right))