Skip to content

Commit a19b037

Browse files
committed
Add Supply.repeated
1 parent 2373000 commit a19b037

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/Type/Supply.pod6

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,22 @@ C<:expires> parameter how long to wait (in seconds) before "resetting"
620620
and not considering a value to have been seen, even if it's the same as
621621
an old value.
622622
623+
=head2 method repeated
624+
625+
method repeated(Supply:D: :&as, :&with)
626+
627+
Creates a supply that only provides repeated values, as defined
628+
by the optional C<:as> and C<:with> parameters (same as with
629+
L<C<unique>|/language/independent-routines#routine_unique>).
630+
631+
my $supply = Supply.from-list(<a A B b c b C>).repeated(:as(&lc));
632+
$supply.tap(&say); # OUTPUT: «A␤b␤b␤C␤»
633+
634+
See L<C<repeated>|/language/independent-routines#routine_repeated>
635+
for more examples that use its sub form.
636+
637+
B<Note>: Available since version 6.e (2020.01 and later).
638+
623639
=head2 method squish
624640
625641
method squish(Supply:D: :$as, :$with --> Supply:D)

0 commit comments

Comments
 (0)