aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/reductions.md24
1 files changed, 20 insertions, 4 deletions
diff --git a/docs/reductions.md b/docs/reductions.md
index 7aadd30b..3cbb6d5d 100644
--- a/docs/reductions.md
+++ b/docs/reductions.md
@@ -69,10 +69,10 @@ a collection using the `_min_` and `_max_` infix operators.
= 10
```
-The `_min_` and `_max_` operators also support field and method call suffixes,
-which makes it very easy to compute the argmin/argmax (or keyed
-minimum/maximum) of a collection. This is when you want to get the minimum or
-maximum value _according to some feature_.
+Reducers also support field and method call suffixes, which makes it very easy
+to compute the argmin/argmax (or keyed minimum/maximum) of a collection. This
+is when you want to get the minimum or maximum value _according to some
+feature_.
```tomo
# Get the longest text:
@@ -84,6 +84,22 @@ maximum value _according to some feature_.
= -4
```
+You can also use suffixes on other operators:
+
+```tomo
+texts := ["x", "y", "z"]
+>> (==: texts)
+= no
+>> (==.length: texts)
+= yes
+>> (+.length: texts)
+= 3
+
+nums := [1, 2, -3]
+>> (+.abs(): nums)
+= 6
+```
+
## Comprehensions
Reductions work not only with iterable values (arrays, sets, integers, etc.),