diff --git a/doc/Type/Any.pod6 b/doc/Type/Any.pod6 index 634619452..320ce76d0 100644 --- a/doc/Type/Any.pod6 +++ b/doc/Type/Any.pod6 @@ -336,7 +336,7 @@ Defined as: method Array(--> Array:D) is nodal -Coerce the invocant to L. +Coerces the invocant to L. =head2 method List @@ -344,7 +344,7 @@ Defined as: method List(--> List:D) is nodal -Coerce the invocant to L, using the L method. +Coerces the invocant to L, using the L method. =head2 serial @@ -367,7 +367,7 @@ Defined as: proto method Hash(|) is nodal multi method Hash( --> Hash:D) -Coerce the invocant to L. +Coerces the invocant to L. =head2 method hash @@ -402,7 +402,7 @@ Defined as: method Slip(--> Slip:D) is nodal -Coerce the invocant to L. +Coerces the invocant to L. =head2 method Map @@ -410,7 +410,7 @@ Defined as: method Map(--> Map:D) is nodal -Coerce the invocant to L. +Coerces the invocant to L. =head2 method Bag @@ -418,7 +418,7 @@ Defined as: method Bag(--> Bag:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method BagHash @@ -427,7 +427,7 @@ Defined as: method BagHash(--> BagHash:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method Set @@ -436,7 +436,7 @@ Defined as: method Set(--> Set:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method SetHash @@ -445,7 +445,7 @@ Defined as: method SetHash(--> SetHash:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method Mix @@ -454,7 +454,7 @@ Defined as: method Mix(--> Mix:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method MixHash @@ -463,7 +463,7 @@ Defined as: method MixHash(--> MixHash:D) is nodal -Coerce the invocant to L, whereby L +Coerces the invocant to L, whereby L are treated as lists of values. =head2 method Supply @@ -472,8 +472,8 @@ Defined as: method Supply(--> Supply:D) is nodal -Coerce the invocant first to a C by applying the invocant's -L«C<.list>|/routine/list» method, and then to a L. +Coerces the invocant first to L by applying its +L«C<.list>|/routine/list» method, and then to L. =head2 method min @@ -482,7 +482,7 @@ Defined as: multi method min(--> Any:D) multi method min(&filter --> Any:D) -Coerces to L and returns the numerically smallest element. +Coerces the invocant to L and returns the numerically smallest element. If a L positional argument is provided, each value is passed into the filter, and its return value is compared instead of the @@ -498,7 +498,7 @@ Defined as: multi method max(--> Any:D) multi method max(&filter --> Any:D) -Coerces to L and returns the numerically largest element. +Coerces the invocant to L and returns the numerically largest element. If a L positional argument is provided, each value is passed into the filter, and its return value is compared instead of the @@ -567,14 +567,12 @@ Defined as: method flatmap(Any:U: &code --> Seq) -Coerces the L to a C by applying the +Coerces the invocant to L by applying its L«C<.list>|/routine/list» method and uses L«C|/type/List#method_flatmap» on it. say Any.flatmap({.reverse}); # OUTPUT: «((Any))␤» -In the case of L, C returns a 1-item list, as is shown. - =head2 method roll Defined as: @@ -582,8 +580,8 @@ Defined as: multi method roll(--> Any) multi method roll($n --> Seq) -Coerces the invocant L to a C by applying -the L«C<.list>|/routine/list» method and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_roll» on it. say Any.roll; # OUTPUT: «(Any)␤» @@ -596,8 +594,8 @@ Defined as: multi method pick(--> Any) multi method pick($n --> Seq) -Coerces the L to a C by applying the -L«C<.list>|/routine/list» method and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_pick» on it. say Any.pick; # OUTPUT: «(Any)␤» @@ -661,7 +659,8 @@ Defined as: method first(Mu $matcher?, :$k, :$kv, :$p, :$end) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_first» on it. say Any.first; # OUTPUT: «(Any)␤» @@ -672,7 +671,8 @@ Defined as: method unique(:&as, :&with --> Seq:D) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_unique» on it. say Any.unique; # OUTPUT: «((Any))␤» @@ -683,7 +683,8 @@ Defined as: method repeated(:&as, :&with --> Seq) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_repeated» on it. say Any.repeated; # OUTPUT: «()␤» @@ -694,7 +695,8 @@ Defined as: method squish(:&as, :&with --> Seq) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_squish» on it. say Any.squish; # OUTPUT: «((Any))␤» @@ -706,7 +708,8 @@ Defined as: method permutations(--> Seq) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_permutations» on it. say Any.permutations; # OUTPUT: «(((Any)))␤» @@ -717,7 +720,8 @@ Defined as: method categorize(&mapper --> Hash:D) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_categorize» on it. say Any.categorize({ $_ }); # OUTPUT: «{(Any) => [(Any)]}␤» @@ -728,7 +732,8 @@ Defined as: method classify(&mapper -->Hash:D) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_classify» on it. say Any.classify({ $_ }); # OUTPUT: «{(Any) => [(Any)]}␤» @@ -743,9 +748,10 @@ Defined as: multi method pairs(Any:U: -->List) multi method pairs(Any:D: -->List) -Returns an empty L if the invocant is undefined, otherwise -converts the invocant to a L via the C method -and calls L on it: +Coerces the invocant to L by applying its L«C<.list>|/routine/list» method +and uses L on it. +Returns an empty L if the invocant is undefined: + say Any.pairs; # OUTPUT: «()␤» my $a; @@ -761,9 +767,10 @@ Defined as: multi method antipairs(Any:U: -->List) multi method antipairs(Any:D: -->List) -Applies the method L to the invocant, if it is defined, -after having invoked C on it. If the invocant is not defined, -it returns an empty L: +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses +L on it. +Returns an empty L if the invocant is undefined: my $a; say $a.antipairs; # OUTPUT: «()» @@ -778,9 +785,10 @@ Defined as: multi method kv(Any:U: -->List) multi method kv(Any:D: -->List) -Returns an empty L if the invocant is not defined, otherwise it -does invoke C on the invocant and then returns the result -of L on the latter: +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses + L on it. +Returns an empty L if the invocant is undefined: my $a; say $a.kv; # OUTPUT: «()» @@ -933,7 +941,8 @@ Defined as: method combinations(--> Seq) -Treats the C as a 1-item list and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_combinations» on it. say Any.combinations; # OUTPUT: «(() ((Any)))␤» @@ -944,7 +953,7 @@ Defined as: method iterator(--> Iterator) -Coerces the C to a C by applying the C<.list> method and uses +Coerces the invocant to L by applying its L«C<.list>|/routine/list» method and uses L«C|/type/Iterable#method_iterator» on it. my $it = Any.iterator; @@ -957,7 +966,8 @@ Defined as: method grep(Mu $matcher, :$k, :$kv, :$p, :$v --> Seq) -Coerces the C to a C by applying the C<.list> method and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#routine_grep» on it. Based on C<$matcher> value can be either C<((Any))> or empty List. @@ -1026,7 +1036,8 @@ Defined as: multi method batch(Int:D $batch --> Seq) multi method batch(Int:D :$elems --> Seq) -Coerces the object to a C by applying the C<.list> method and uses +Coerces the invocant to L by applying +its L«C<.list>|/routine/list» method and uses L«C|/type/List#method_batch» on it. =end pod