Skip to content

Commit cd0f6ff

Browse files
committed
- get a bunch of routines into the index
- roast does not demand those to be multies, so neither should the docs
1 parent 7d4cc98 commit cd0f6ff

File tree

1 file changed

+63
-63
lines changed

1 file changed

+63
-63
lines changed

doc/Type/List.pod6

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ Coercion to Bool also indicates if the List got any elements.
8989
9090
Defined as:
9191
92-
multi sub elems($list --> Int:D)
93-
multi method elems(List:D: --> Int:D)
92+
sub elems($list --> Int:D)
93+
method elems(List:D: --> Int:D)
9494
9595
Returns the number of elements in the list.
9696
@@ -100,8 +100,8 @@ Returns the number of elements in the list.
100100
101101
Defined as:
102102
103-
multi sub end($list --> Int:D)
104-
multi method end(List:D: --> Int:D)
103+
sub end($list --> Int:D)
104+
method end(List:D: --> Int:D)
105105
106106
Returns the index of the last element.
107107
@@ -111,8 +111,8 @@ Returns the index of the last element.
111111
112112
Defined as:
113113
114-
multi sub keys($list --> Seq:D)
115-
multi method keys(List:D: --> Seq:D)
114+
sub keys($list --> Seq:D)
115+
method keys(List:D: --> Seq:D)
116116
117117
Returns a sequence of indexes into the list (e.g., 0..(@list.elems-1)).
118118
@@ -122,8 +122,8 @@ Returns a sequence of indexes into the list (e.g., 0..(@list.elems-1)).
122122
123123
Defined as:
124124
125-
multi sub values($list --> Seq:D)
126-
multi method values(List:D: --> Seq:D)
125+
sub values($list --> Seq:D)
126+
method values(List:D: --> Seq:D)
127127
128128
Returns a sequence of the list elements, in order.
129129
@@ -134,8 +134,8 @@ Returns a sequence of the list elements, in order.
134134
135135
Defined as:
136136
137-
multi sub kv($list --> Seq:D)
138-
multi method kv(List:D: --> Seq:D)
137+
sub kv($list --> Seq:D)
138+
method kv(List:D: --> Seq:D)
139139
140140
Returns an interleaved sequence of indexes and values. For example
141141
@@ -145,8 +145,8 @@ Returns an interleaved sequence of indexes and values. For example
145145
146146
Defined as:
147147
148-
multi sub pairs($list --> Seq:D)
149-
multi method pairs(List:D: --> Seq:D)
148+
sub pairs($list --> Seq:D)
149+
method pairs(List:D: --> Seq:D)
150150
151151
Returns a sequence of pairs, with the indexes as keys and the list values as
152152
values.
@@ -157,7 +157,7 @@ values.
157157
158158
Defined as:
159159
160-
multi method antipairs(List:D: --> Seq:D)
160+
method antipairs(List:D: --> Seq:D)
161161
162162
Returns a L<Seq|/type/Seq> of pairs, with the values as keys and the indexes as
163163
values, i.e. the direct opposite to L<pairs|/type/List#routine_pairs>.
@@ -168,8 +168,8 @@ values, i.e. the direct opposite to L<pairs|/type/List#routine_pairs>.
168168
169169
Defined as:
170170
171-
multi sub join($separator, *@list --> Str:D)
172-
multi method join(List:D: $separator --> Str:D)
171+
sub join($separator, *@list --> Str:D)
172+
method join(List:D: $separator --> Str:D)
173173
174174
Treats the elements of the list as strings, interleaves them with
175175
C<$separator> and concatenates everything into a single string.
@@ -186,8 +186,8 @@ Note that the method form does not flatten sublists:
186186
187187
Defined as:
188188
189-
multi sub map(&code, *@elems --> Seq:D)
190-
multi method map(List:D: &code --> Seq:D)
189+
sub map(&code, *@elems --> Seq:D)
190+
method map(List:D: &code --> Seq:D)
191191
192192
Invokes C<&code> for each element and gathers the return values in a sequence
193193
and returns it. This happens lazily, i.e. C<&code> is only invoked when the
@@ -263,8 +263,8 @@ invokes L<uc|/type/Str#routine_uc> four times.
263263
264264
Defined as:
265265
266-
multi sub grep(Mu $matcher, *@elems, :$k, :$kv, :$p, :$v --> Seq:D)
267-
multi method grep(List:D: Mu $matcher, :$k, :$kv, :$p, :$v --> Seq:D)
266+
sub grep(Mu $matcher, *@elems, :$k, :$kv, :$p, :$v --> Seq:D)
267+
method grep(List:D: Mu $matcher, :$k, :$kv, :$p, :$v --> Seq:D)
268268
269269
Returns a sequence of elements against which C<$matcher> smart-matches.
270270
The elements are returned in the order in which they appear in the original
@@ -305,8 +305,8 @@ Examples:
305305
306306
Defined as:
307307
308-
multi sub first(Mu $matcher, *@elems, :$k, :$kv, :$p, :$end)
309-
multi method first(List:D: Mu $matcher?, :$k, :$kv, :$p, :$end)
308+
sub first(Mu $matcher, *@elems, :$k, :$kv, :$p, :$end)
309+
method first(List:D: Mu $matcher?, :$k, :$kv, :$p, :$end)
310310
311311
Returns the first item of the list which smart-matches against C<$matcher>,
312312
returns Nil when no values match. The optional named parameter C<:end>
@@ -350,7 +350,7 @@ L«C<head>|/routine/head» and L«C<tail>|/routine/tail» methods.
350350
351351
Defined as:
352352
353-
multi method head(List:D: Int(Cool) $number = 1 --> Seq:D)
353+
method head(List:D: Int(Cool) $number = 1 --> Seq:D)
354354
355355
Returns the B<first> NUMBER items of the list. Returns an empty list if
356356
NUMBER <= 0. Defaults to the first element seen if no NUMBER specified.
@@ -366,7 +366,7 @@ Examples:
366366
367367
Defined as:
368368
369-
multi method tail(List:D: Int(Cool) $number = 1 --> Seq:D)
369+
method tail(List:D: Int(Cool) $number = 1 --> Seq:D)
370370
371371
Returns a L<Seq> containing the B<last> NUMBER items of the list. Returns an empty Seq if
372372
NUMBER <= 0. Defaults to the last element if no NUMBER is specified.
@@ -384,8 +384,8 @@ say ^Inf .tail # Cannot tail a lazy list
384384
385385
Defined as:
386386
387-
multi sub categorize(&mapper, *@values --> Hash:D)
388-
multi method categorize(List:D: &mapper --> Hash:D)
387+
sub categorize(&mapper, *@values --> Hash:D)
388+
method categorize(List:D: &mapper --> Hash:D)
389389
390390
Transforms a list of values into a hash representing the categorizations
391391
of those values according to a mapper; each hash key represents one possible
@@ -411,8 +411,8 @@ Example:
411411
412412
Defined as:
413413
414-
multi sub classify(&mapper, *@values --> Hash:D)
415-
multi method classify(List:D: &mapper --> Hash:D)
414+
sub classify(&mapper, *@values --> Hash:D)
415+
method classify(List:D: &mapper --> Hash:D)
416416
417417
Transforms a list of values into a hash
418418
representing the classification of those values according to a mapper;
@@ -432,7 +432,7 @@ Example:
432432
433433
Defined as:
434434
435-
multi method Bool(List:D: --> Bool:D)
435+
method Bool(List:D: --> Bool:D)
436436
437437
Returns C<True> if the list has at least one element, and C<False>
438438
for the empty list.
@@ -444,7 +444,7 @@ for the empty list.
444444
445445
Defined as:
446446
447-
multi method Str(List:D: --> Str:D)
447+
method Str(List:D: --> Str:D)
448448
449449
Stringifies the elements of the list and joins them with spaces
450450
(same as C<.join(' ')>).
@@ -455,7 +455,7 @@ Stringifies the elements of the list and joins them with spaces
455455
456456
Defined as:
457457
458-
multi method Int(List:D: --> Int:D)
458+
method Int(List:D: --> Int:D)
459459
460460
Returns the number of elements in the list (same as C<.elems>).
461461
@@ -465,7 +465,7 @@ Returns the number of elements in the list (same as C<.elems>).
465465
466466
Defined as:
467467
468-
multi method Numeric(List:D: --> Int:D)
468+
method Numeric(List:D: --> Int:D)
469469
470470
Returns the number of elements in the list (same as C<.elems>).
471471
@@ -506,9 +506,9 @@ against a L<Signature|/type/Signature>.
506506
507507
Defined as:
508508
509-
multi sub pick($count, *@list --> Seq:D)
510-
multi method pick(List:D: $count --> Seq:D)
511-
multi method pick(List:D: --> Mu)
509+
sub pick($count, *@list --> Seq:D)
510+
method pick(List:D: $count --> Seq:D)
511+
method pick(List:D: --> Mu)
512512
513513
If C<$count> is supplied: Returns C<$count> elements chosen at random
514514
and without repetition from the invocant. If C<*> is passed as C<$count>,
@@ -528,9 +528,9 @@ Examples:
528528
529529
Defined as:
530530
531-
multi sub roll($count, *@list --> Seq:D)
532-
multi method roll(List:D: $count --> Seq:D)
533-
multi method roll(List:D: --> Mu)
531+
sub roll($count, *@list --> Seq:D)
532+
method roll(List:D: $count --> Seq:D)
533+
method roll(List:D: --> Mu)
534534
535535
If C<$count> is supplied: Returns a sequence of C<$count> elements, each randomly
536536
selected from the list. Each random choice is made independently, like a separate
@@ -553,7 +553,7 @@ Examples:
553553
554554
Defined as:
555555
556-
multi method eager(List:D: --> List:D)
556+
method eager(List:D: --> List:D)
557557
sub eager(*@elems --> List:D)
558558
559559
Evaluates all elements in the list eagerly, and returns them as a list.
@@ -564,8 +564,8 @@ Evaluates all elements in the list eagerly, and returns them as a list.
564564
565565
Defined as:
566566
567-
multi sub reverse(*@list --> List:D)
568-
multi method reverse(List:D: --> List:D)
567+
sub reverse(*@list --> List:D)
568+
method reverse(List:D: --> List:D)
569569
570570
Returns a list with the same elements in reverse order.
571571
@@ -581,8 +581,8 @@ Examples:
581581
582582
Defined as:
583583
584-
multi sub rotate(@list, Int:D $n = 1 --> List:D)
585-
multi method rotate(List:D: Int:D $n = 1 --> List:D)
584+
sub rotate(@list, Int:D $n = 1 --> List:D)
585+
method rotate(List:D: Int:D $n = 1 --> List:D)
586586
587587
Returns the list rotated by C<$n> elements.
588588
@@ -595,10 +595,10 @@ Examples:
595595
596596
Defined as:
597597
598-
multi sub sort(*@elems --> Seq:D)
599-
multi sub sort(&by, *@elems --> Seq:D)
600-
multi method sort(List:D: --> Seq:D)
601-
multi method sort(List:D: &by --> Seq:D)
598+
sub sort(*@elems --> Seq:D)
599+
sub sort(&by, *@elems --> Seq:D)
600+
method sort(List:D: --> Seq:D)
601+
method sort(List:D: &by --> Seq:D)
602602
603603
Sorts the list, smallest element first. By default C<< infix:<cmp> >>
604604
is used for comparing list elements.
@@ -621,8 +621,8 @@ Examples:
621621
622622
Defined as:
623623
624-
multi sub unique(*@values, :&as, :&with --> Seq:D)
625-
multi method unique(List:D: :&as, :&with --> Seq:D)
624+
sub unique(*@values, :&as, :&with --> Seq:D)
625+
method unique(List:D: :&as, :&with --> Seq:D)
626626
627627
Returns a sequence of B<unique> values from the invocant/argument list, such
628628
that only the first occurrence of each duplicated value remains in the
@@ -660,8 +660,8 @@ Example:
660660
661661
Defined as:
662662
663-
multi sub repeated(*@values, :&as, :&with --> Seq:D)
664-
multi method repeated(List:D: :&as, :&with --> Seq:D)
663+
sub repeated(*@values, :&as, :&with --> Seq:D)
664+
method repeated(List:D: :&as, :&with --> Seq:D)
665665
666666
Returns a sequence of B<repeated> values from the invocant/argument list.
667667
It takes the same parameters as L<C<unique>>, but instead of passing through
@@ -681,8 +681,8 @@ Examples:
681681
682682
Defined as:
683683
684-
multi sub squish(*@values, :&as --> Seq:D)
685-
multi method squish(List:D: :&as --> Seq:D)
684+
sub squish(*@values, :&as --> Seq:D)
685+
method squish(List:D: :&as --> Seq:D)
686686
687687
Returns a sequence of values from the invocant/argument list where runs
688688
of more than one value are replaced with only the first instance.
@@ -704,8 +704,8 @@ temporarily transformed before comparison.
704704
705705
Defined as:
706706
707-
multi sub reduce(&with, *@values)
708-
multi method reduce(List:D: &with)
707+
sub reduce(&with, *@values)
708+
method reduce(List:D: &with)
709709
710710
Generates a single "combined" value from a list of arbitrarily many of values,
711711
by iteratively applying a function which knows how to combine I<two> values.
@@ -772,8 +772,8 @@ it is a left fold.
772772
773773
Defined as:
774774
775-
multi sub produce(&with, *@values)
776-
multi method produce(List:D: &with)
775+
sub produce(&with, *@values)
776+
method produce(List:D: &with)
777777
778778
Generates a list of all intermediate "combined" values along with the final
779779
result by iteratively applying a function which knows how to combine I<two>
@@ -829,9 +829,9 @@ C<redo> statements inside C<&with>:
829829
830830
Defined as:
831831
832-
multi sub combinations($n, $k --> Seq:D)
833-
multi method combinations(List:D: Int:D $of --> Seq:D)
834-
multi method combinations(List:D: Range:D $of = 0..* --> Seq:D)
832+
sub combinations($n, $k --> Seq:D)
833+
method combinations(List:D: Int:D $of --> Seq:D)
834+
method combinations(List:D: Range:D $of = 0..* --> Seq:D)
835835
836836
The C<Int> variant returns all C<$of>-combinations of the invocant list.
837837
For example
@@ -877,8 +877,8 @@ systems have a limit of C<2³¹-1> and 32-bit systems have a limit of C<2²⁸-1
877877
878878
Defined as:
879879
880-
multi sub permutations($n --> Seq:D)
881-
multi method permutations(List:D: --> Seq:D)
880+
sub permutations($n --> Seq:D)
881+
method permutations(List:D: --> Seq:D)
882882
883883
Returns all possible permutations of a list as a sequence of lists. So
884884
@@ -1066,8 +1066,8 @@ post-processing step can then be undertaken.
10661066
10671067
Defined as:
10681068
1069-
multi sub sum($list --> Numeric:D)
1070-
multi method sum(List:D: --> Numeric:D)
1069+
sub sum($list --> Numeric:D)
1070+
method sum(List:D: --> Numeric:D)
10711071
10721072
Returns the sum of all elements in the list or 0 if the list is empty.
10731073
Throws an exception if an element can not be coerced into Numeric.

0 commit comments

Comments
 (0)