Skip to content

Commit 8d40c49

Browse files
committed
add Stream.run/1
1 parent e6f1856 commit 8d40c49

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
\matrix [list=a, opacity=0.5] {
2+
\node [index=1]; &
3+
\node [index=2]; &
4+
\node [elements between]; &
5+
\node [index=n]; \\
6+
};
7+
8+
\matrix [list=b, element=a, right=1 of list a] {
9+
\node [index=1]; &
10+
\node [index=2]; &
11+
\node [elements between]; &
12+
\node [index=n]; \\
13+
};
14+
15+
\coordinate (x) at ($ (list a.east)!.5!(list b.west) $);
16+
17+
\node at (x) {$\Rightarrow$};
18+
19+
\node (x) [below=1 of x] {$\Downarrow$};
20+
\node [below=of x] {\texttt{:ok}};
21+
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
22
title: run/1
33
url: /Stream/run/1
4-
draft: true
54
---
65

7-
# `Stream.run/1`
8-
Brief description and usage of the `Stream`'s `run/1` function.
6+
Materializes the given `stream`.
7+
8+
This is useful when a stream needs to be run, for side effects, and there is no interest in its return result.
99

1010
{{< figure src="images/functions/Stream/run-1.svg" >}}
11-
{{< figure src="images/functions/Stream/run-1.2.svg" >}}
12-
{{< figure src="images/functions/Stream/run-1.3.svg" >}}

data/signatures.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,11 @@
11181118
defmodule Stream do
11191119
def resource(start_fun, fun, after_fun)
11201120
end
1121+
- name: run/1
1122+
signature: |
1123+
defmodule Stream do
1124+
def run(stream)
1125+
end
11211126
- name: scan/2
11221127
signature: |
11231128
defmodule Stream do

0 commit comments

Comments
 (0)