Documentation for routine flatmap

Documentation for routine flatmap, assembled from the following types:

class Any

From Any

(Any) method flatmap

Defined As:

    method flatmap(--> TODO)


class List

From List

(List) method flatmap

Defined as:

method flatmap(List:D: &code --> Seq:D)

Like map iterates over the elements of the invocant list, feeding each element in turn to the code reference, and assembling the return values from these invocations in a result list.

Unlike map it flattens non-itemized lists and arrays, so

say ((12), <a b>).flatmap(&uc).join('|');     # OUTPUT: «1 2|A B␤» 

invokes uc four times.