<div dir="ltr"><div>Hi Stefan,<br><br></div>That looks quite nice and expressive. In the context of a discussion we have been having about describing `matmul/@` and possibly broadcastable dimensions, I think from your description it sounds like one would describe `@` with multiple functions (the multiple dispatch we have been (are?) considering as well):<br><br><br> "... * N * M * T, ... * M * P * T -> ... * N * P * T"<br> "M * T, ... * M * P * T -> ... P * T"<br> "... * N * M * T, M * T -> ... * N * T"<br> "M * T, M * T -> T"<div class="gmail_extra"><br></div><div class="gmail_extra">Is there a way to describe broadcasting?  The sample case we've come up with is a function that calculates a weighted mean. This might take (values, sigmas) and return (mean, sigma_mean), which would imply a signature like: <br><br></div><div class="gmail_extra">"... N * T, ... N * T -> ... * T, ... * T"<br><br></div><div class="gmail_extra">But would your signature allow indicating that one could pass in a single sigma? I.e., broadcast the second 1 to N if needed?<br><br></div><div class="gmail_extra">I realize that this is no longer about describing precisely what the function doing the calculation expects, but rather what an upper level is allowed to do before calling the function (i.e., take a dimension of 1 and broadcast it).<br><br></div><div class="gmail_extra">All the best,<br><br></div><div class="gmail_extra">Marten<br></div></div>