You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -429,15 +429,46 @@ Continuations are often seen in asynchronous programming when the program needs
429
429
```
430
430
431
431
432
-
## Point-Free Style (TODO)
432
+
## Point-Free Style
433
433
434
-
Writing functions where the definition does not explicitly identify the arguments used. This style usually requires [currying](#currying) or other [Higher-Order functions](#higher-order-functions-hof). A.K.A Tacit programming.
434
+
Point-Free is a style of writting code without using any intermediate variables.
435
+
436
+
Basically, you will end up with long chains of direct function calls.
437
+
This style usually requires [currying](#currying) or other [Higher-Order functions](#higher-order-functions-hof).
438
+
This technique is also sometimes called "Tacit programming".
439
+
440
+
The most common example of Point-Free programming style is Unix with pipes:
441
+
442
+
```bash
443
+
ps aux | grep [k]de | gawk '{ print $2 }'
444
+
```
445
+
446
+
It also works for Python, let's say you have this function composition:
435
447
436
448
```python
437
-
#TODO
449
+
>>>str(bool(abs(-1)))
450
+
'True'
438
451
```
439
452
440
-
Points-free function definitions look just like normal assignments without `def` or `lambda`.
453
+
It might be problematic method methods on the first sight, because you need an instance to call a method on.
454
+
But, you can always use HOF to fix that and compose normally:
0 commit comments