Today I had to do some array juggling and was looking for Bicep functions to assist me. I found the concat, intersection and union functions particularly helpful. However, some "set theory" functions seemed notably absent.
In particular I was looking for a difference/complement/except function except(A, B), that would return all elements present in array A, but not in array B. Like this:
Another would be the symmetric difference/disjunctive union of arrays, symmetricExcept(A, B), that would return all elements present in array A and array B, but not in both. Like this:
Of course there are more "set theory" functions (carthesian product comes to mind) missing. And maybe these proposed functions can be realized using some alternative Bicep code/lambda expressions. It sure would've helped me today if these functions were already available in Bicep, so I thought I'd add this feature suggestion. My sample is based on arrays, but just like some of the already existing functions, I imagine they should also be available for objects.
It would also be worth covering distinct(<array>) with this task. Currently I believe a workaround is achievable with unique(<array>, <array>), but this isn't very discoverable.
Today I had to do some array juggling and was looking for Bicep functions to assist me. I found the
concat
,intersection
andunion
functions particularly helpful. However, some "set theory" functions seemed notably absent.In particular I was looking for a difference/complement/except function
except(A, B)
, that would return all elements present in arrayA
, but not in arrayB
. Like this:Another would be the symmetric difference/disjunctive union of arrays,
symmetricExcept(A, B)
, that would return all elements present in arrayA
and arrayB
, but not in both. Like this:Of course there are more "set theory" functions (carthesian product comes to mind) missing. And maybe these proposed functions can be realized using some alternative Bicep code/lambda expressions. It sure would've helped me today if these functions were already available in Bicep, so I thought I'd add this feature suggestion. My sample is based on arrays, but just like some of the already existing functions, I imagine they should also be available for objects.