deepmap
ErrorsCollection

deepmap

Synthesised documentation from type/Any

From type/Any

See Original text in context

method deepmap(&block --> Listis nodal

deepmap will apply &block to each element and return a new Any with the return values of &block, unless the element does the Iterable role. For those elements deepmap will descend recursively into the sublist.

say [[1,2,3],[[4,5],6,7]].deepmap(* + 1);
# OUTPUT: «[[2 3 4] [[5 6] 7 8]]␤»

In the case of Associatives, it will be applied to its values:

{ what => "is"this => "thing"=> <real list> }.deepmap*.flip ).say
# OUTPUT: «{a => (laer tsil), this => gniht, what => si}␤»