-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documents RaceSeq, some fixes and adds to type-graph.txt closes #1897
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
=begin pod | ||
=TITLE class RaceSeq | ||
=SUBTITLE Performs batches of work in parallel without respecting original | ||
order. | ||
class RaceSeq does Iterable does Sequence { } | ||
An RaceSeq is the intermediate object used when the operator | ||
L<C<race>|/routine/race> is invoked on a L<C<Seq>|/type/Seq>. In general, | ||
it's not intended for direct consumption by the developer. | ||
=head1 Methods | ||
=head2 method iterator | ||
method iterator(RaceSeq:D: --> Iterator:D) | ||
Returns the underlying iterator. | ||
=head2 method grep | ||
method grep(RaceSeq:D: $matcher, *%options) | ||
Applies C<grep> to the C<RaceSeq> similarly to how it would do it on a Seq. | ||
=for code | ||
my @raced = (^10000).map(*²).race; | ||
@raced.grep( * %% 3 ).say; | ||
# OUTPUT: «(0 9 36 81 144 …» | ||
When you use C<race> on a C<Seq>, this is the method that is actually called. | ||
=head2 method map | ||
method map(RaceSeq:D: $matcher, *%options) | ||
Uses maps on the C<RaceSeq>, generally created by application of C<.race> to | ||
a preexisting C<Seq>. | ||
=head2 method invert | ||
method invert(RaceSeq:D:) | ||
Inverts the C<RaceSeq> created from a C<Seq> by C<.race>. | ||
=head2 method race | ||
method race(RaceSeq:D:) | ||
Returns the object. | ||
=head2 method hyper | ||
method hyper(RaceSeq:D:) | ||
Creates a C<HyperSeq> object out of the current one. | ||
=head2 method serial | ||
multi method serial(RaceSeq:D:) | ||
Converts the object to a C<Seq> and returns it. | ||
=head2 method is-lazy | ||
method is-lazy(--> False ) | ||
Returns C<False>. | ||
=head2 method sink | ||
Defined as: | ||
method sink(--> Nil) | ||
Sinks the underlying data structure, producing any side effects. | ||
=end pod | ||
|
||
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters