Skip to content

Commit edd8bb5

Browse files
committed
update chunk_while/4
1 parent 8dff4de commit edd8bb5

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

assets/images/functions/Enum/chunk_while-4.2.tex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
\tikzset{
22
chunk fun/.style={
3-
fun={\texttt{chunk}\\\texttt{fun}},
3+
fun,
44
function arity=2,
5-
align=center,
6-
font=\large,
75
},
86
after fun/.style={
9-
fun={\texttt{after}\\\texttt{fun}},
10-
align=center,
11-
font=\large,
7+
fun={\texttt{after}\_\texttt{fun}},
128
}
139
}
1410

assets/images/functions/Enum/chunk_while-4.tex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
\tikzset{
22
chunk fun/.style={
3-
fun={\texttt{chunk}\\\texttt{fun}},
3+
fun,
44
function arity=2,
5-
align=center,
6-
font=\large,
75
},
86
after fun/.style={
9-
fun={\texttt{after}\\\texttt{fun}},
10-
align=center,
11-
font=\large,
7+
fun={\texttt{after}\_\texttt{fun}},
128
}
139
}
1410

content/en/functions/Enum/chunk_while-4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ url: Enum/chunk_while/4
55

66
Chunks `enumerable` with fine grained control when every chunk is emitted.
77

8-
`chunk_fun` receives the current element and the accumulator and must return
8+
`fun` receives the current element and the accumulator and must return
99

1010
- `{:cont, chunk, acc}` to emit the given chunk and continue with accumulator or
1111
- `{:cont, acc}` to not emit any chunk and continue with the return accumulator.
@@ -14,6 +14,6 @@ Chunks `enumerable` with fine grained control when every chunk is emitted.
1414

1515
{{< figure src="images/functions/Enum/chunk_while-4.svg" >}}
1616

17-
The iteration stops as soon as `chunk_fun` returns a tuple of the form `{:halt, acc}`.
17+
The iteration stops as soon as `fun` returns a tuple of the form `{:halt, acc}`.
1818

1919
{{< figure src="images/functions/Enum/chunk_while-4.2.svg" >}}

content/en/functions/Stream/chunk_while-4.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ title: chunk_while/4
33
url: /Stream/chunk_while/4
44
---
55

6-
Brief description and usage of the `Stream`'s `chunk_while/4` function.
6+
Chunks `stream` with fine grained control when every chunk is emitted.
7+
8+
`fun` receives the current element and the accumulator and must return
9+
10+
- `{:cont, chunk, acc}` to emit the given chunk and continue with accumulator or
11+
- `{:cont, acc}` to not emit any chunk and continue with the return accumulator.
12+
13+
`after_fun` is invoked when iteration is done and must also return `{:cont, chunk, acc}` or `{:cont, acc}`.
714

815
{{< figure src="images/functions/Stream/chunk_while-4.svg" >}}
16+
17+
The iteration stops as soon as `fun` returns a tuple of the form `{:halt, acc}`.
18+
919
{{< figure src="images/functions/Stream/chunk_while-4.2.svg" >}}

data/signatures.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- name: chunk_while/4
5757
signature: |
5858
defmodule Enum do
59-
def chunk_while(enumerable, acc, chunk_fun, after_fun)
59+
def chunk_while(enumerable, acc, fun, after_fun)
6060
end
6161
- name: concat/1
6262
signature: |
@@ -1031,7 +1031,7 @@
10311031
- name: chunk_while/4
10321032
signature: |
10331033
defmodule Stream do
1034-
def chunk_while(stream, acc, chunk_fun, after_fun)
1034+
def chunk_while(stream, acc, fun, after_fun)
10351035
end
10361036
- name: cycle/1
10371037
signature: |

0 commit comments

Comments
 (0)