Skip to content

Commit 85feebe

Browse files
authored
Merge pull request #2252 from MorayJ/any-list-clarity
Any list clarity
2 parents e31068d + eb0d861 commit 85feebe

File tree

1 file changed

+50
-42
lines changed

1 file changed

+50
-42
lines changed

doc/Type/Any.pod6

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,15 @@ Defined as:
336336
337337
method Array(--> Array:D) is nodal
338338
339-
Coerce the invocant to L<Array>.
339+
Coerces the invocant to L<Array>.
340340
341341
=head2 method List
342342
343343
Defined as:
344344
345345
method List(--> List:D) is nodal
346346
347-
Coerce the invocant to L<List>, using the L<list> method.
347+
Coerces the invocant to L<List>, using the L<list> method.
348348
349349
=head2 serial
350350
@@ -367,7 +367,7 @@ Defined as:
367367
proto method Hash(|) is nodal
368368
multi method Hash( --> Hash:D)
369369
370-
Coerce the invocant to L<Hash>.
370+
Coerces the invocant to L<Hash>.
371371
372372
=head2 method hash
373373
@@ -402,23 +402,23 @@ Defined as:
402402
403403
method Slip(--> Slip:D) is nodal
404404
405-
Coerce the invocant to L<Slip>.
405+
Coerces the invocant to L<Slip>.
406406
407407
=head2 method Map
408408
409409
Defined as:
410410
411411
method Map(--> Map:D) is nodal
412412
413-
Coerce the invocant to L<Map>.
413+
Coerces the invocant to L<Map>.
414414
415415
=head2 method Bag
416416
417417
Defined as:
418418
419419
method Bag(--> Bag:D) is nodal
420420
421-
Coerce the invocant to L<Bag>, whereby L<Positionals|/type/Positional>
421+
Coerces the invocant to L<Bag>, whereby L<Positionals|/type/Positional>
422422
are treated as lists of values.
423423
424424
=head2 method BagHash
@@ -427,7 +427,7 @@ Defined as:
427427
428428
method BagHash(--> BagHash:D) is nodal
429429
430-
Coerce the invocant to L<BagHash>, whereby L<Positionals|/type/Positional>
430+
Coerces the invocant to L<BagHash>, whereby L<Positionals|/type/Positional>
431431
are treated as lists of values.
432432
433433
=head2 method Set
@@ -436,7 +436,7 @@ Defined as:
436436
437437
method Set(--> Set:D) is nodal
438438
439-
Coerce the invocant to L<Set>, whereby L<Positionals|/type/Positional>
439+
Coerces the invocant to L<Set>, whereby L<Positionals|/type/Positional>
440440
are treated as lists of values.
441441
442442
=head2 method SetHash
@@ -445,7 +445,7 @@ Defined as:
445445
446446
method SetHash(--> SetHash:D) is nodal
447447
448-
Coerce the invocant to L<SetHash>, whereby L<Positionals|/type/Positional>
448+
Coerces the invocant to L<SetHash>, whereby L<Positionals|/type/Positional>
449449
are treated as lists of values.
450450
451451
=head2 method Mix
@@ -454,7 +454,7 @@ Defined as:
454454
455455
method Mix(--> Mix:D) is nodal
456456
457-
Coerce the invocant to L<Mix>, whereby L<Positionals|/type/Positional>
457+
Coerces the invocant to L<Mix>, whereby L<Positionals|/type/Positional>
458458
are treated as lists of values.
459459
460460
=head2 method MixHash
@@ -463,7 +463,7 @@ Defined as:
463463
464464
method MixHash(--> MixHash:D) is nodal
465465
466-
Coerce the invocant to L<MixHash>, whereby L<Positionals|/type/Positional>
466+
Coerces the invocant to L<MixHash>, whereby L<Positionals|/type/Positional>
467467
are treated as lists of values.
468468
469469
=head2 method Supply
@@ -472,8 +472,8 @@ Defined as:
472472
473473
method Supply(--> Supply:D) is nodal
474474
475-
Coerce the invocant first to a C<list> by applying the invocant's
476-
L«C<.list>|/routine/list» method, and then to a L<Supply>.
475+
Coerces the invocant first to a C<list> by applying its
476+
L«C<.list>|/routine/list» method, and then to L<Supply>.
477477
478478
=head2 method min
479479
@@ -482,7 +482,7 @@ Defined as:
482482
multi method min(--> Any:D)
483483
multi method min(&filter --> Any:D)
484484
485-
Coerces to L<Iterable> and returns the numerically smallest element.
485+
Coerces the invocant to L<Iterable> and returns the numerically smallest element.
486486
487487
If a L<Callable> positional argument is provided, each value is passed
488488
into the filter, and its return value is compared instead of the
@@ -498,7 +498,7 @@ Defined as:
498498
multi method max(--> Any:D)
499499
multi method max(&filter --> Any:D)
500500
501-
Coerces to L<Iterable> and returns the numerically largest element.
501+
Coerces the invocant to L<Iterable> and returns the numerically largest element.
502502
503503
If a L<Callable> positional argument is provided, each value is passed
504504
into the filter, and its return value is compared instead of the
@@ -567,23 +567,21 @@ Defined as:
567567
568568
method flatmap(Any:U: &code --> Seq)
569569
570-
Coerces the L<Any> to a C<list> by applying the
570+
Coerces the invocant to a C<list> by applying its
571571
L«C<.list>|/routine/list» method and uses
572572
L«C<List.flatmap>|/type/List#method_flatmap» on it.
573573
574574
say Any.flatmap({.reverse}); # OUTPUT: «((Any))␤»
575575
576-
In the case of L<Any>, C<Any.list> returns a 1-item list, as is shown.
577-
578576
=head2 method roll
579577
580578
Defined as:
581579
582580
multi method roll(--> Any)
583581
multi method roll($n --> Seq)
584582
585-
Coerces the invocant L<Any> to a C<list> by applying
586-
the L«C<.list>|/routine/list» method and uses
583+
Coerces the invocant to a C<list> by applying
584+
its L«C<.list>|/routine/list» method and uses
587585
L«C<List.roll>|/type/List#routine_roll» on it.
588586
589587
say Any.roll; # OUTPUT: «(Any)␤»
@@ -596,8 +594,8 @@ Defined as:
596594
multi method pick(--> Any)
597595
multi method pick($n --> Seq)
598596
599-
Coerces the L<Any> to a C<list> by applying the
600-
L«C<.list>|/routine/list» method and uses
597+
Coerces the invocant to a C<list> by applying
598+
its L«C<.list>|/routine/list» method and uses
601599
L«C<List.pick>|/type/List#routine_pick» on it.
602600
603601
say Any.pick; # OUTPUT: «(Any)␤»
@@ -661,7 +659,8 @@ Defined as:
661659
662660
method first(Mu $matcher?, :$k, :$kv, :$p, :$end)
663661
664-
Treats the C<Any> as a 1-item list and uses
662+
Coerces the invocant to a C<list> by applying
663+
its L«C<.list>|/routine/list» method and uses
665664
L«C<List.first>|/type/List#routine_first» on it.
666665
667666
say Any.first; # OUTPUT: «(Any)␤»
@@ -672,7 +671,8 @@ Defined as:
672671
673672
method unique(:&as, :&with --> Seq:D)
674673
675-
Treats the C<Any> as a 1-item list and uses
674+
Coerces the invocant to a C<list> by applying
675+
its L«C<.list>|/routine/list» method and uses
676676
L«C<List.unique>|/type/List#routine_unique» on it.
677677
678678
say Any.unique; # OUTPUT: «((Any))␤»
@@ -683,7 +683,8 @@ Defined as:
683683
684684
method repeated(:&as, :&with --> Seq)
685685
686-
Treats the C<Any> as a 1-item list and uses
686+
Coerces the invocant to a C<list> by applying
687+
its L«C<.list>|/routine/list» method and uses
687688
L«C<List.repeated>|/type/List#routine_repeated» on it.
688689
689690
say Any.repeated; # OUTPUT: «()␤»
@@ -694,7 +695,8 @@ Defined as:
694695
695696
method squish(:&as, :&with --> Seq)
696697
697-
Treats the C<Any> as a 1-item list and uses
698+
Coerces the invocant to a C<list> by applying
699+
its L«C<.list>|/routine/list» method and uses
698700
L«C<List.squish>|/type/List#routine_squish» on it.
699701
700702
say Any.squish; # OUTPUT: «((Any))␤»
@@ -706,7 +708,8 @@ Defined as:
706708
707709
method permutations(--> Seq)
708710
709-
Treats the C<Any> as a 1-item list and uses
711+
Coerces the invocant to a C<list> by applying
712+
its L«C<.list>|/routine/list» method and uses
710713
L«C<List.permutations>|/type/List#routine_permutations» on it.
711714
712715
say Any.permutations; # OUTPUT: «(((Any)))␤»
@@ -717,7 +720,8 @@ Defined as:
717720
718721
method categorize(&mapper --> Hash:D)
719722
720-
Treats the C<Any> as a 1-item list and uses
723+
Coerces the invocant to a C<list> by applying
724+
its L«C<.list>|/routine/list» method and uses
721725
L«C<List.categorize>|/type/List#routine_categorize» on it.
722726
723727
say Any.categorize({ $_ }); # OUTPUT: «{(Any) => [(Any)]}␤»
@@ -728,7 +732,8 @@ Defined as:
728732
729733
method classify(&mapper -->Hash:D)
730734
731-
Treats the C<Any> as a 1-item list and uses
735+
Coerces the invocant to a C<list> by applying
736+
its L«C<.list>|/routine/list» method and uses
732737
L«C<List.classify>|/type/List#routine_classify» on it.
733738
734739
say Any.classify({ $_ }); # OUTPUT: «{(Any) => [(Any)]}␤»
@@ -743,9 +748,9 @@ Defined as:
743748
multi method pairs(Any:U: -->List)
744749
multi method pairs(Any:D: -->List)
745750
746-
Returns an empty L<List> if the invocant is undefined, otherwise
747-
converts the invocant to a L<List> via the C<list> method
748-
and calls L<List.pairs|/type/List#routine_pairs> on it:
751+
Converts the invocant to a L<List> via the C<list> method and returns the result of L<List.pairs|/type/List#routine_pairs> on it.
752+
Returns an empty L<List> if the invocant is undefined:
753+
749754
750755
say Any.pairs; # OUTPUT: «()␤»
751756
my $a;
@@ -761,9 +766,9 @@ Defined as:
761766
multi method antipairs(Any:U: -->List)
762767
multi method antipairs(Any:D: -->List)
763768
764-
Applies the method L<List.antipairs|/type/List#routine_antipairs> to the invocant, if it is defined,
765-
after having invoked C<list> on it. If the invocant is not defined,
766-
it returns an empty L<List>:
769+
Converts the invocant to a L<List> via the C<list> method and returns the result of
770+
L<List.antipairs|/type/List#routine_antipairs> on it.
771+
Returns an empty L<List> if the invocant is undefined:
767772
768773
my $a;
769774
say $a.antipairs; # OUTPUT: «()»
@@ -778,9 +783,9 @@ Defined as:
778783
multi method kv(Any:U: -->List)
779784
multi method kv(Any:D: -->List)
780785
781-
Returns an empty L<List> if the invocant is not defined, otherwise it
782-
does invoke C<list> on the invocant and then returns the result
783-
of L<List.kv|/type/List#routine_kv> on the latter:
786+
Invokes C<list> on the invocant and returns the result of
787+
L<List.kv|/type/List#routine_kv> on it.
788+
Returns an empty L<List> if the invocant is undefined:
784789
785790
my $a;
786791
say $a.kv; # OUTPUT: «()»
@@ -933,7 +938,8 @@ Defined as:
933938
934939
method combinations(--> Seq)
935940
936-
Treats the C<Any> as a 1-item list and uses
941+
Coerces the invocant to a C<list> by applying
942+
its L«C<.list>|/routine/list» method and uses
937943
L«C<List.combinations>|/type/List#routine_combinations» on it.
938944
939945
say Any.combinations; # OUTPUT: «(() ((Any)))␤»
@@ -944,7 +950,7 @@ Defined as:
944950
945951
method iterator(--> Iterator)
946952
947-
Coerces the C<Any> to a C<list> by applying the C<.list> method and uses
953+
Coerces the invocant to a C<list> by applying its L«C<.list>|/routine/list» method and uses
948954
L«C<iterator>|/type/Iterable#method_iterator» on it.
949955
950956
my $it = Any.iterator;
@@ -957,7 +963,8 @@ Defined as:
957963
958964
method grep(Mu $matcher, :$k, :$kv, :$p, :$v --> Seq)
959965
960-
Coerces the C<Any> to a C<list> by applying the C<.list> method and uses
966+
Coerces the invocant to a C<list> by applying
967+
its L«C<.list>|/routine/list» method and uses
961968
L«C<List.grep>|/type/List#routine_grep» on it.
962969
963970
Based on C<$matcher> value can be either C<((Any))> or empty List.
@@ -1026,7 +1033,8 @@ Defined as:
10261033
multi method batch(Int:D $batch --> Seq)
10271034
multi method batch(Int:D :$elems --> Seq)
10281035
1029-
Coerces the object to a C<List> by applying the C<.list> method and uses
1036+
Coerces the invocant to a C<list> by applying
1037+
its L«C<.list>|/routine/list» method and uses
10301038
L«C<List.batch>|/type/List#method_batch» on it.
10311039
10321040
=end pod

0 commit comments

Comments
 (0)