You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://docs.perl6.org/type/List#method_flatmap incorrectly suggests that flatmap flattenes the input list before iterating it, when in fact it seems to flatten the result of the map operation:
The example given on the page should be removed altogether, as it lies about &uc being called four times (it's called twice, once for each element of the input list), and doesn't produce a nested output so there's nothing to flatten, and thus fails to demonstrate what flatmap actually does.
The text was updated successfully, but these errors were encountered:
The previous example's explanation was wrong, and the example
had the same result on both .map and .flatmap, making it an
even more confusing function.
The documentation now strongly recommends use of .map.flat and
recommends to instead using the confusing .flatmap
Fixes issue #851.
https://docs.perl6.org/type/List#method_flatmap incorrectly suggests that
flatmapflattenes the input list before iterating it, when in fact it seems to flatten the result of the map operation:The example given on the page should be removed altogether, as it lies about
&ucbeing called four times (it's called twice, once for each element of the input list), and doesn't produce a nested output so there's nothing to flatten, and thus fails to demonstrate whatflatmapactually does.The text was updated successfully, but these errors were encountered: