Skip to content

Commit e5d116a

Browse files
committed
Document some more Set operators
1 parent 718f98a commit e5d116a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

lib/Set.pod

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,62 @@ not contain C<$b>.
6969
7070
=head2 infix:<(|)>
7171
72+
only sub infix:<(|)>(**@p)
73+
74+
Returns the union of all of its arguments. Unless any of its arguments
75+
are L<Baggy>, this creates a new C<Set> that contains all the elements
76+
its arguments contain.
77+
7278
=head2 infix:<∪>
7379
80+
only sub infix:<<"\x222A">>(|p)
81+
82+
Equivalent to L<(|)>.
83+
7484
=head2 infix:<(&)>
7585
86+
only sub infix:<(&)>(**@p)
87+
88+
Returns the intersection of all of its arguments. Unless any of its
89+
arguments are L<Baggy>, this creates a new C<Set> that contains only the
90+
elements that all of its arguments contain.
91+
7692
=head2 infix:<∩>
7793
94+
only sub infix:<<"\x2229">>(|p)
95+
96+
Equivalent to L<(&)>.
97+
7898
=head2 infix:<(-)>
7999
100+
only sub infix:<(-)>(**@p)
101+
102+
Unless the first argument is L<Baggy>, returns the C<Set> made up all
103+
the elements the first argument has but the rest don't, i.e., of all the
104+
elements of the first argument, minus the elements from the other
105+
arguments.
106+
80107
=head2 infix:<∖>
81108
109+
only sub infix:<<"\x2216">>(|p)
110+
111+
Equivalent to L<(-)>.
112+
82113
=head2 infix:<(^)>
83114
115+
multi sub infix:<(^)>(Any $a, Any $b --> Setty)
116+
multi sub infix:<(^)>(Set $a, Set $b --> Setty)
117+
118+
Returns the C<Set> made up of all the elements that $a has but $b
119+
doesn't and all the elements $b has but $a doesn't. Equivalent to
120+
C<($a ∖ $b) ∪ ($b ∖ $a)>.
121+
84122
=head2 infix:<⊖>
85123
124+
only sub infix:<<"\x2296">>($a, $b --> Setty)
125+
126+
Equivalent to L<(^)>
127+
86128
=head2 infix:<(<=)>
87129
88130
=head2 infix:<⊆>

0 commit comments

Comments
 (0)