My question is: how to best define functions so they compose nicely?
Here is the confusion. The following doesn’t work:
f(x) = x, x
g(a,b) = a+b
h = g∘f
h(1)
This produces a “MethodError: no method matching g(::Tuple{Int64,Int64})”
It works, however, if I add
g(xs) = g(xs...)
But I don’t really understand why. Much appreciated if someone can help me understand how to better define functions for composition.