Documentation for infix (&)

Documentation for infix (&), assembled from the following types:

language documentation Sets, Bags, and Mixes

From Sets, Bags, and Mixes

(Sets, Bags, and Mixes) infix (&)

only sub infix:<(&)>(**@p)

Intersection operator.

Returns the intersection of all of its arguments. Generally, this creates a new Set that contains only the elements common to all of the arguments.

<a b c> (&) <b c d> === set <b c>
<a b c d> (&) <b c d e> (&) <c d e f> === set <c d>

If any of the arguments are Baggy, the result is a new Bag containing the common elements, each weighted by the largest common weight (which is the minimum of the weights of that element over all arguments).

bag(<a a b c a>(&) bag(<a a b c c>=== bag(<a a b c>)

infix ∩

only sub infix:<>(|p)

Intersection operator (alternate).

Equivalent to (&), at codepoint U+2229 (INTERSECTION).