18 lines
272 B
Markdown
18 lines
272 B
Markdown
|
# Function Composition
|
||
|
|
||
|
Allows you to compose functions seemlessly.
|
||
|
|
||
|
```python
|
||
|
>>> from compose import Compose
|
||
|
>>> def add2(x):
|
||
|
... return x + 2
|
||
|
...
|
||
|
>>> def mul3(x):
|
||
|
... return x * 3
|
||
|
...
|
||
|
>>> Compose >> add2 >> mul3
|
||
|
add2 >> mul3
|
||
|
>>> Compose >> add2 >> mul3 | 10
|
||
|
36
|
||
|
```
|