Skip to content

Commit f3b58a1

Browse files
committed
Document with of squish
1 parent e5893a7 commit f3b58a1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/Type/List.pod6

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,8 +745,8 @@ Examples:
745745
746746
Defined as:
747747
748-
multi sub squish(*@values, :&as --> Seq:D)
749-
multi method squish(List:D: :&as --> Seq:D)
748+
multi sub squish(*@values, :&as, :&with --> Seq:D)
749+
multi method squish(List:D: :&as, :&with --> Seq:D)
750750
751751
Returns a sequence of values from the invocant/argument list where runs
752752
of more than one value are replaced with only the first instance.
@@ -764,6 +764,13 @@ Examples:
764764
The optional C<:as> parameter, just like with L<C<unique>>, allows values to be
765765
temporarily transformed before comparison.
766766
767+
The optional C<:with> parameter is used to set an appropriate comparsion operator:
768+
769+
say [42, "42"].squish; # OUTPUT: «(42 42)␤»
770+
# Note that the second item in the result is still Str
771+
say [42, “42”].squish(with => &infix:<eq>); # OUTPUT: «(42)␤»
772+
# The resulting item is Int
773+
767774
=head2 routine reduce
768775
769776
Defined as:

0 commit comments

Comments
 (0)