rev: 08a0786d94a50b3b229836c53a03976f10ab6bd7 scopes/doc/docs/module-itertools.md -rw-r--r-- 5.5 KiB
08a0786d94a5Shawn Walker-Salas * drop number sections in menu due to readthedocs theme incompatibility 17 days ago
`                                                                                `
```1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123```
```<style type="text/css" rel="stylesheet">body { counter-reset: chapter 16; }</style>

itertools
=========

itertools provides various utilities which simplify the composition of
generators and collectors.

:   A constant of type `Collector`.

:

:   A variant of dim optimized for power of two sizes; the dimensions are
specified as exponents of 2.

:   Two collectors:

- Every time a is full, b collects a and a is reset.
- When b ends, the remainder of a is collected.

:   Treat input as a generator and forward its arguments individually.

:   Run collector until full and return the result.

:   A reducing sink for mux streams.

:   A branchless generator that iterates multidimensional coordinates.

:   Fold output from generator into collector.

:

:   Collect variadic input as individual single items.

:   If f is true, collect input in a, otherwise collect in b. When both are
full, output both. Until both are full, new input for full containers

:

:   Generate one variadic argument from N generated arguments.

:

:

:   Send input into multiple collectors which each fork the target collector.

:   Return a generator that iterates all permutations of the range from 0
to `n`, where `n` must be smaller than 256, and returns a vector of
`element-type` for each iteration. If `element-type` is omitted, the
default element type will be i32.

The generator will perform `n!` iterations to complete.

:

:   Feeds the input through a composition of collectors and feeds the input
along with the composition output to the next collector. If mapl is not
none, it allows specifying the portion of the input that will be passed
to the end point.

:   Limit collector to output n items.

: