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

=TITLE class HyperSeq

=SUBTITLE An object for performing batches of work in parallel with ordered
output

    class HyperSeq does Iterable does Sequence { }

An C<HyperSeq> is the intermediate object used when
L<C<hyper>|/routine/hyper> 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(HyperSeq:D: --> Iterator:D)

Returns the underlying iterator.

=head2 method grep

    method grep(HyperSeq:D: $matcher, *%options)

Applies C<grep> to the C<HyperSeq> similarly to how it would do it on a C<Seq>.

=for code
my @hyped = (^10000).map(*²).hyper;
@hyped.grep( * %% 3 ).say;
# OUTPUT: «(0 9 36 81 144 ...)»

When you use C<hyper> on a C<Seq>, this is the method that is actually called.

=head2 method map

    method map(HyperSeq:D: $matcher, *%options)

Uses maps on the C<HyperSeq>, generally created by application of C<hyper> to
 a preexisting C<Seq>.

=head2 method invert

    method invert(HyperSeq:D:)

Inverts the C<HyperSeq> created from a C<Seq> by C<.hyper>.

=head2 method hyper

    method hyper(HyperSeq:D:)

Returns the object.

=head2 method race

    method race(HyperSeq:D:)

Creates a C<RaceSeq> object out of the current one.

=head2 method serial

    multi method serial(HyperSeq: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
