=begin pod :kind("Type") :subkind("class") :category("basic")

=TITLE class RaceSeq

=SUBTITLE Performs batches of work in parallel without respecting original
order.

    class RaceSeq does Iterable does Sequence { }

An C<RaceSeq> is the intermediate object used when
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 C<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
