Skip to content

Commit d3f2534

Browse files
committed
doc Any.deepmap
1 parent b42b053 commit d3f2534

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/Type/Any.pod6

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ C<map> will iterate over the invocant and apply the number of positional
158158
parameters of the code object from the invocant per call. The returned values
159159
of the code object will become elements of the returned C<Seq>.
160160
161+
=head2 method deepmap(&block -->List) is nodal
162+
163+
C<deepmap> will apply C<&block> to each element and return a new C<List> with
164+
the return values of C<&block>, unless the element does the C<Iterable> role.
165+
For those elements C<deepmap> will decent recursively into the sublist.
166+
167+
dd [[1,2,3],[[4,5],6,7]].deepmap(*+1);
168+
# OUTPUT«[[2, 3, 4], [[5, 6], 7, 8]]␤»
169+
161170
=head2 method flat
162171
163172
Interprets the invocant as a list, flattens it, and returns that list. Please

0 commit comments

Comments
 (0)