Skip to content

Commit 94de4ee

Browse files
authored
docs: add example for piping anonymous fn (#47)
Signed-off-by: rodesousa <dessroberto@gmail.com>
1 parent cd2ab8a commit 94de4ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,14 @@ square = & &1 * &1
655655

656656
The above style is much better than previous . You can also use `fn` to define anonymous functions.
657657

658+
Or use `Kernel.then/2` function since 1.12.0
659+
660+
```elixir
661+
[1, 2, 3, 4, 5]
662+
|> length()
663+
|> then(& &1 * &1)
664+
```
665+
658666
<hr>
659667

660668
### Retrieve Character Integer Codepoints — ?

0 commit comments

Comments
 (0)