We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 089622d commit cad8319Copy full SHA for cad8319
README.md
@@ -168,11 +168,16 @@ pipelines:
168
```python
169
from expression.collections import seq, Seq
170
171
+# Since static type checkes aren't good good at inferring lambda types
172
+mapper: Callable[[int], int] = lambda x: x * 10
173
+predicate: Callable[[int], bool] = lambda x: x > 100
174
+folder: Callable[[int, int], int] = lambda s, x: s + x
175
+
176
xs = Seq.of(9, 10, 11)
177
ys = xs.pipe(
- seq.map(lambda x: x * 10),
- seq.filter(lambda x: x > 100),
- seq.fold(lambda s, x: s + x, 0)
178
+ seq.map(mapper),
179
+ seq.filter(predicate),
180
+ seq.fold(folder, 0),
181
)
182
183
assert ys == 110
0 commit comments