by 6gvONxR4sf7o · 2y ago · 0 comments
> Non-commutativity can be emulated by adding an extra argument that determines the ordering or by giving them different names.
Would you mind giving an example? (or just tell me it’s in the docs and i’ll look deeper)
f(1,...)*f(2,...)
Then when you do pattern matching with wildcards x_ and y_ you can do f(x_,...)*f(y_,..)
with the requirement that x_ < y_. This way you will know you match them in the expected order and not the other way around.