Skip to content

Commit 7cc2fcf

Browse files
committed
Wrap paragraphs consistently in setbagmix.pod
1 parent a20bdc5 commit 7cc2fcf

File tree

1 file changed

+56
-57
lines changed

1 file changed

+56
-57
lines changed

lib/Language/setbagmix.pod

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
55
=SUBTITLE Unique collections and weighted lists in Perl 6
66
7-
Often, one wants to work with lists of values that are unique. While
8-
calling L<C<.unique>|unique> on the list repeatedly is certainly an option,
9-
better still is to use a L<B<C<Set>>|Set> or L<B<C<SetHash>>|SetHash>,
10-
whose elements are guaranteed to be unique.
7+
Often, one wants to work with lists of values that are unique. While calling
8+
L<C<.unique>|unique> on the list repeatedly is certainly an option, better
9+
still is to use a L<B<C<Set>>|Set> or L<B<C<SetHash>>|SetHash>, whose
10+
elements are guaranteed to be unique.
1111
1212
=begin comment
1313
=defn Set or SetHash
@@ -16,9 +16,8 @@ Collection of distinct objects
1616
1717
Other times, one wants to keep track of the number of occurrences of an
1818
item. One could use a hash E<emdash> or use the built-in L<B<C<Bag>>|Bag> or
19-
L<B<C<BagHash>>|BagHash> types (for integer numbers) or the
20-
L<B<C<Mix>>|Mix> or L<B<C<MixHash>>|MixHash> types (for arbitrary
21-
numbers).
19+
L<B<C<BagHash>>|BagHash> types (for integer numbers) or the L<B<C<Mix>>|Mix>
20+
or L<B<C<MixHash>>|MixHash> types (for arbitrary numbers).
2221
2322
=begin comment
2423
=defn Bag or BagHash
@@ -35,15 +34,15 @@ TODO: Partial type graph showing only QuantHash, Setty, Baggy, Mixy, Set,
3534
The six collection classes C<Set>, C<SetHash>, C<Bag>, C<BagHash>, C<Mix>,
3635
C<MixHash>, all share similar semantics.
3736
38-
For one thing, as far as they are concerned, identical objects refer to the same
39-
element -- where identity is determined using the L<WHICH> methods (i.e. the same
40-
way that the L<===> operator checks identity). For value types like C<Str>, this
41-
means having the same value; for reference types like C<Array>, it means
42-
referring to the same object instance.
37+
For one thing, as far as they are concerned, identical objects refer to the
38+
same element -- where identity is determined using the L<WHICH> methods
39+
(i.e. the same way that the L<===> operator checks identity). For value
40+
types like C<Str>, this means having the same value; for reference types
41+
like C<Array>, it means referring to the same object instance.
4342
44-
Secondly, they provide a Hash-like interface where the actual elements of the
45-
collection (which can be objects of any type) are the 'keys', and the associated
46-
weights are the 'values':
43+
Secondly, they provide a Hash-like interface where the actual elements of
44+
the collection (which can be objects of any type) are the 'keys', and the
45+
associated weights are the 'values':
4746
4847
=table
4948
value of $a{$b} if $b value of $a{$b} if $b
@@ -58,23 +57,23 @@ weights are the 'values':
5857
=comment TODO: Update this after ab5tract's set/bag/mix operator redesign.
5958
6059
There are many infixes devoted to preforming common operations on
61-
L<C<Set>s|Set>, such as unions and set differences. Other operations
62-
include boolean checks, like whether an object is an element of a
63-
C<Set>, or whether one C<Set> is a subset of another C<Set>.
60+
L<C<Set>s|Set>, such as unions and set differences. Other operations include
61+
boolean checks, like whether an object is an element of a C<Set>, or whether
62+
one C<Set> is a subset of another C<Set>.
6463
65-
These infixes can be written using the UTF-8 character that represents
66-
the function (like L<C<>|∈>, or L<C<>|∪>), or they can be written with
67-
an equivalent ASCII version (like L<C<(elem)>|(elem)> or L<C<(|)>|(|)>).
64+
These infixes can be written using the UTF-8 character that represents the
65+
function (like L<C<>|∈>, or L<C<>|∪>), or they can be written with an
66+
equivalent ASCII version (like L<C<(elem)>|(elem)> or L<C<(|)>|(|)>).
6867
6968
Most of the time, explicitly using C<Set> objects with these infixes is
7069
unnecessary. All of the infix operators will work on any objects of type
7170
L<C<Any>|Any> for its arguments (e.g., L<C<List>s|List>,
7271
L<C<Parcel>s|Parcel>, L<C<Mix>es|Mix>, etc.) and coerce them to C<Set>s
7372
where needed.
7473
75-
In some cases, if the type of an argument is a L<Bag>, the
76-
infix operator will behave in a different but analogous way to the way
77-
it would behave with only C<Set> arguments.
74+
In some cases, if the type of an argument is a L<Bag>, the infix operator
75+
will behave in a different but analogous way to the way it would behave with
76+
only C<Set> arguments.
7877
7978
=head2 Operators that return C<Bool>
8079
@@ -95,8 +94,8 @@ Equivalent to L«(elem)».
9594
9695
only sub infix:<<"\x2209">>($a, $b --> Bool)
9796
98-
Equivalent to C<!(elem)>, i.e., returns C<True> if C<$a> is not an
99-
element of C<$b>.
97+
Equivalent to C<!(elem)>, i.e., returns C<True> if C<$a> is not an element
98+
of C<$b>.
10099
101100
=head3 infix (cont)
102101
@@ -115,16 +114,16 @@ Equivalent to L«(cont)».
115114
116115
only sub infix:<<"\x220C">>($a, $b --> Bool)
117116
118-
Equivalent to C<!(cont)>, i.e., returns C<True> if C<$a> does
119-
not contain C<$b>.
117+
Equivalent to C<!(cont)>, i.e., returns C<True> if C<$a> does not contain
118+
C<$b>.
120119
121120
=head3 infix (<=)
122121
123122
multi sub infix:<<(<=)>>(Any $a, Any $b --> Bool)
124123
multi sub infix:<<(<=)>>(Setty $a, Setty $b --> Bool)
125124
126-
Returns C<True> if C<$a> is a B<subset> or is equal to C<$b>, i.e., if all the
127-
elements of C<$a> are elements of C<$b> and C<$a> is a smaller or equal
125+
Returns C<True> if C<$a> is a B<subset> or is equal to C<$b>, i.e., if all
126+
the elements of C<$a> are elements of C<$b> and C<$a> is a smaller or equal
128127
sized set than C<$b>.
129128
130129
=head4 infix ⊆
@@ -165,8 +164,8 @@ Equivalent to C«!(<)».
165164
multi sub infix:<<(>=)>>(Any $a, Any $b --> Bool)
166165
multi sub infix:<<(>=)>>(Setty $a, Setty $b --> Bool)
167166
168-
Like L«(<=)» with reversed arguments. Returns C<True> if C<$a>
169-
is a B<superset> of or equal to C<$b>.
167+
Like L«(<=)» with reversed arguments. Returns C<True> if C<$a> is a
168+
B<superset> of or equal to C<$b>.
170169
171170
=head4 infix ⊇
172171
@@ -185,8 +184,8 @@ Equivalent to C«!(>=)».
185184
multi sub infix:<<(>)>>(Any $a, Any $b --> Bool)
186185
multi sub infix:<<(>)>>(Setty $a, Setty $b --> Bool)
187186
188-
Like L«(<)» with reversed arguments. Returns C<True> if C<$a>
189-
is a B<strict superset> of C<$b>.
187+
Like L«(<)» with reversed arguments. Returns C<True> if C<$a> is a
188+
B<strict superset> of C<$b>.
190189
191190
=head4 infix ⊃
192191
@@ -221,8 +220,8 @@ Equivalent to L«(<+)».
221220
multi sub infix:<<(>+)>>(Any $a, Any $b --> Bool)
222221
223222
Returns C<True> if C<$a> is a Baggy B<superset> of C<$b>, i.e., if all the
224-
elements of C<$b> are in C<$a> and no argument of C<$a> is weighted
225-
heavier than that element is in C<$b>.
223+
elements of C<$b> are in C<$a> and no argument of C<$a> is weighted heavier
224+
than that element is in C<$b>.
226225
227226
=head4 infix ≽
228227
@@ -241,9 +240,9 @@ C<Set> that contains all the elements its arguments contain.
241240
242241
<a a b c d> (|) <h g f e d c> (|) <i j> === set <a b c d e f g h i j>
243242
244-
If any of its arguments are C<Baggy>, it creates a new C<Bag> that
245-
contains all the elements of the arguments, each weighed by the highest
246-
weight that appeared for that element.
243+
If any of its arguments are C<Baggy>, it creates a new C<Bag> that contains
244+
all the elements of the arguments, each weighed by the highest weight that
245+
appeared for that element.
247246
248247
bag(<a a b c a>) (|) bag(<a a b c c>) === bag(<a a a b c c>)
249248
@@ -257,16 +256,16 @@ Equivalent to L«(V<|>)».
257256
258257
only sub infix:<(&)>(**@p)
259258
260-
Returns the B<intersection> of all of its arguments. Generally, this
261-
creates a new C<Set> that contains only the elements that all of its
262-
arguments contain.
259+
Returns the B<intersection> of all of its arguments. Generally, this creates
260+
a new C<Set> that contains only the elements that all of its arguments
261+
contain.
263262
264263
<a b c> (&) <b c d> === set <b c>
265264
<a b c d> (&) <b c d e> (&) <c d e f> === set <c d>
266265
267266
If any of its arguments are C<Baggy>, this creates a new C<Bag> that
268-
contains only the elements that all of the arguments contain, each
269-
weighted by the maximum weight all of the arguments share for that element.
267+
contains only the elements that all of the arguments contain, each weighted
268+
by the maximum weight all of the arguments share for that element.
270269
271270
bag(<a a b c a>) (&) bag(<a a b c c>) === bag(<a a b c>)
272271
@@ -280,14 +279,14 @@ Equivalent to L«(&)».
280279
281280
only sub infix:<(-)>(**@p)
282281
283-
Returns the B<set difference> of all its arguments. Generally, this
284-
returns the C<Set> made up of all the elements the first argument has but
285-
the rest don't, i.e., of all the elements of the first argument, minus
286-
the elements from the other arguments.
282+
Returns the B<set difference> of all its arguments. Generally, this returns
283+
the C<Set> made up of all the elements the first argument has but the rest
284+
don't, i.e., of all the elements of the first argument, minus the elements
285+
from the other arguments.
287286
288287
If the first argument is C<Baggy>, this returns a C<Bag> that contains each
289-
element of the first argument with its weight subtracted by the weight
290-
of that element in each of the other arguments.
288+
element of the first argument with its weight subtracted by the weight of
289+
that element in each of the other arguments.
291290
292291
bag(<a a b c a d>) (-) bag(<a a b c c>) = bag(<a d>)
293292
bag(<a a a a c d d d>) (-) bag(<a b d a>) (-) bag(<d c>) = bag(<a a d d>)
@@ -303,10 +302,10 @@ Equivalent to L«(-)».
303302
multi sub infix:<(^)>(Any $a, Any $b --> Setty)
304303
multi sub infix:<(^)>(Set $a, Set $b --> Setty)
305304
306-
Returns the B<symmetric set difference> of all its arguments, i.e., a
307-
C<Set> made up of all the elements that C<$a> has but C<$b> doesn't and
308-
all the elements C<$b> has but C<$a> doesn't. Equivalent to C<($a ∖ $b)
309-
∪ ($b ∖ $a)>.
305+
Returns the B<symmetric set difference> of all its arguments, i.e., a C<Set>
306+
made up of all the elements that C<$a> has but C<$b> doesn't and all the
307+
elements C<$b> has but C<$a> doesn't. Equivalent to C<($a ∖ $b) ∪ ($b ∖
308+
$a)>.
310309
311310
=head4 infix ⊖
312311
@@ -335,9 +334,9 @@ Equivalent to L«(.)».
335334
336335
only sub infix:<(+)>(**@p)
337336
338-
Returns the Baggy B<addition> of its arguments, i.e., a C<Bag> that
339-
contains each element of the arguments with the weights of the element
340-
across the arguments added together to get the new weight.
337+
Returns the Baggy B<addition> of its arguments, i.e., a C<Bag> that contains
338+
each element of the arguments with the weights of the element across the
339+
arguments added together to get the new weight.
341340
342341
bag(<a a b c a d>) (.) bag(<a a b c c>) === bag(<a a a a a b b c c c d>)
343342

0 commit comments

Comments
 (0)