Skip to content

Commit

Permalink
Clarify the status of "produce"
Browse files Browse the repository at this point in the history
And add tests
  • Loading branch information
lizmat committed May 31, 2024
1 parent 2244899 commit faaa8d7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Revision history for ParaSeq
- Updated status of ".flat" and added tests
- Updated status of ".invert" and added tests
- Updated status of ".permutations" and added tests
- Updated status of ".produce" and added tests

0.0.7 2024-05-30T14:24:50+02:00
- Added optimized ".batch" and tests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ pick
produce
-------

[`.produce`](https://docs.raku.org/type/Any#routine_produce)
**Status**: the nature of the [`.produce`](https://docs.raku.org/type/Any#routine_produce) method basically makes it impossible to hyper. Therefore, **no** specific hypering logic has been added for this method.

repeated
--------
Expand Down
5 changes: 4 additions & 1 deletion doc/ParaSeq.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ hypering logic has been added for this method.

=head2 produce

L<C<.produce>|https://docs.raku.org/type/Any#routine_produce>
B<Status>: the nature of the
L<C<.produce>|https://docs.raku.org/type/Any#routine_produce> method
basically makes it impossible to hyper. Therefore, B<no> specific
hypering logic has been added for this method.

=head2 repeated

Expand Down
17 changes: 17 additions & 0 deletions t/42-produce.rakutest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use Test;
use ParaSeq;

plan 4;

my constant $elems = 200000;
my constant @list = (^$elems).List;
my constant @produced = @list.produce(&[+]).List;
my constant $batch = 16;

for 1, ParaSeq.default-degree {
my $seq := @list.&hyperize($batch, $_).produce(&[+]);
isa-ok $seq, $_ == 1 ?? Seq !! ParaSeq;
is-deeply $seq.List, @produced, ".produce(&[+]) with degree = $_";
}

# vim: expandtab shiftwidth=4

0 comments on commit faaa8d7

Please sign in to comment.