Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove doc for sub cross because ENOSPEC (issue #165 on roast)
  • Loading branch information
gfldex committed Oct 5, 2016
1 parent b7cdcfe commit b101e5e
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions doc/Type/List.pod6
Expand Up @@ -895,34 +895,6 @@ Combining multiple cycles and C<:partial> also works:
See L<this blog post for more elaboration on rotor|http://perl6.party/post/Perl-6-.rotor-The-King-of-List-Manipulation>.
=head2 routine cross
sub cross(+@e, :&with) returns Seq:D
Computes the cross-product of two or more lists or L<iterables|/type/Iterable>.
This returns a sequence of lists where the first item in each list is an item
from the first iterable, the second is from the second given iterable, etc.
Every item will be paired with every other item in all the other lists.
say cross(<a b c>, <d e f>).map(*.join).join(",")
# ad,ae,af,bd,be,bf,cd,ce,cf
The C<cross> routine has an infix synonym as well, named C<X>.
say (<a b c> X <d e f>).map(*.join).join(",")
# output is the same as the previous example
If the optional C<with> parameter is passed, it is used as a reduction operation
to apply to each of the cross product items.
say cross([1, 2, 3], [4, 5, 6], :with(&infix:<*>)).join(",");
# 4,5,6,8,10,12,12,15,18
The C<X> operator can be combined with another operator as a meta-operator to perform a reduction as well:
say ([1, 2, 3] X* [4, 5, 6]).join(",")
# same output as the previous example
=head2 routine zip
Defined as:
Expand Down

0 comments on commit b101e5e

Please sign in to comment.