[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 1b9061c 090/316: Update docs
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 1b9061c 090/316: Update docs |
Date: |
Mon, 15 Feb 2021 15:57:32 -0500 (EST) |
branch: externals/dash
commit 1b9061c5f506d657e157f046752e27ca3552ab78
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>
Update docs
---
README.md | 88 +++++++++++++++++++++++++++++++++++------
dash.texi | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 192 insertions(+), 28 deletions(-)
diff --git a/README.md b/README.md
index c24960d..95c6f7b 100644
--- a/README.md
+++ b/README.md
@@ -135,6 +135,10 @@ Functions reducing lists into single value.
* [-reduce-r-from](#-reduce-r-from-fn-initial-value-list) `(fn initial-value
list)`
* [-reduce](#-reduce-fn-list) `(fn list)`
* [-reduce-r](#-reduce-r-fn-list) `(fn list)`
+* [-reductions-from](#-reductions-from-fn-init-list) `(fn init list)`
+* [-reductions-r-from](#-reductions-r-from-fn-init-list) `(fn init list)`
+* [-reductions](#-reductions-fn-list) `(fn list)`
+* [-reductions-r](#-reductions-r-fn-list) `(fn list)`
* [-count](#-count-pred-list) `(pred list)`
* [-sum](#-sum-list) `(list)`
* [-running-sum](#-running-sum-list) `(list)`
@@ -910,6 +914,62 @@ See also:
[`-reduce-r-from`](#-reduce-r-from-fn-initial-value-list), [`-reduce`]
(--reduce-r (format "%s-%s" acc it) '(1 2 3)) ;; => "3-2-1"
```
+#### -reductions-from `(fn init list)`
+
+Return a list of the intermediate values of the reduction.
+
+See [`-reduce-from`](#-reduce-from-fn-initial-value-list) for explanation of
the arguments.
+
+See also: [`-reductions`](#-reductions-fn-list),
[`-reductions-r`](#-reductions-r-fn-list), [`-reduce-r`](#-reduce-r-fn-list)
+
+```el
+(-reductions-from (lambda (a i) (format "(%s FN %s)" a i)) "INIT" '(1 2 3 4))
;; => '("INIT" "(INIT FN 1)" "((INIT FN 1) FN 2)" "(((INIT FN 1) FN 2) FN 3)"
"((((INIT FN 1) FN 2) FN 3) FN 4)")
+(-reductions-from 'max 0 '(2 1 4 3)) ;; => '(0 2 2 4 4)
+(-reductions-from '* 1 '(1 2 3 4)) ;; => '(1 1 2 6 24)
+```
+
+#### -reductions-r-from `(fn init list)`
+
+Return a list of the intermediate values of the reduction.
+
+See [`-reduce-r-from`](#-reduce-r-from-fn-initial-value-list) for explanation
of the arguments.
+
+See also: [`-reductions-r`](#-reductions-r-fn-list),
[`-reductions`](#-reductions-fn-list), [`-reduce`](#-reduce-fn-list)
+
+```el
+(-reductions-r-from (lambda (i a) (format "(%s FN %s)" i a)) "INIT" '(1 2 3
4)) ;; => '("(1 FN (2 FN (3 FN (4 FN INIT))))" "(2 FN (3 FN (4 FN INIT)))" "(3
FN (4 FN INIT))" "(4 FN INIT)" "INIT")
+(-reductions-r-from 'max 0 '(2 1 4 3)) ;; => '(4 4 4 3 0)
+(-reductions-r-from '* 1 '(1 2 3 4)) ;; => '(24 24 12 4 1)
+```
+
+#### -reductions `(fn list)`
+
+Return a list of the intermediate values of the reduction.
+
+See [`-reduce`](#-reduce-fn-list) for explanation of the arguments.
+
+See also: [`-reductions-from`](#-reductions-from-fn-init-list),
[`-reductions-r`](#-reductions-r-fn-list), [`-reduce-r`](#-reduce-r-fn-list)
+
+```el
+(-reductions (lambda (a i) (format "(%s FN %s)" a i)) '(1 2 3 4)) ;; => '(1
"(1 FN 2)" "((1 FN 2) FN 3)" "(((1 FN 2) FN 3) FN 4)")
+(-reductions '+ '(1 2 3 4)) ;; => '(1 3 6 10)
+(-reductions '* '(1 2 3 4)) ;; => '(1 2 6 24)
+```
+
+#### -reductions-r `(fn list)`
+
+Return a list of the intermediate values of the reduction.
+
+See [`-reduce-r`](#-reduce-r-fn-list) for explanation of the arguments.
+
+See also: [`-reductions-r-from`](#-reductions-r-from-fn-init-list),
[`-reductions`](#-reductions-fn-list), [`-reduce`](#-reduce-fn-list)
+
+```el
+(-reductions-r (lambda (i a) (format "(%s FN %s)" i a)) '(1 2 3 4)) ;; =>
'("(1 FN (2 FN (3 FN 4)))" "(2 FN (3 FN 4))" "(3 FN 4)" 4)
+(-reductions-r '+ '(1 2 3 4)) ;; => '(10 9 7 4)
+(-reductions-r '* '(1 2 3 4)) ;; => '(24 24 12 4)
+```
+
#### -count `(pred list)`
Counts the number of items in `list` where (`pred` item) is non-nil.
@@ -933,10 +993,12 @@ Return the sum of `list`.
Return a list with running sums of items in `list`.
+`list` must be non-empty.
+
```el
-(-running-sum '()) ;; => nil
-(-running-sum '(1)) ;; => '(1)
(-running-sum '(1 2 3 4)) ;; => '(1 3 6 10)
+(-running-sum '(1)) ;; => '(1)
+(-running-sum '()) ;; Error
```
#### -product `(list)`
@@ -953,10 +1015,12 @@ Return the product of `list`.
Return a list with running products of items in `list`.
+`list` must be non-empty.
+
```el
-(-running-product '()) ;; => nil
-(-running-product '(1)) ;; => '(1)
(-running-product '(1 2 3 4)) ;; => '(1 2 6 24)
+(-running-product '(1)) ;; => '(1)
+(-running-product '()) ;; Error
```
#### -min `(list)`
@@ -1507,22 +1571,22 @@ Return the permutations of `list`.
#### -inits `(list)`
-Return all non-empty prefixes of `list`.
+Return all prefixes of `list`.
```el
-(-inits '(1 2 3 4)) ;; => '((1) (1 2) (1 2 3) (1 2 3 4))
-(-inits nil) ;; => nil
-(-inits '(1)) ;; => '((1))
+(-inits '(1 2 3 4)) ;; => '(nil (1) (1 2) (1 2 3) (1 2 3 4))
+(-inits nil) ;; => '(nil)
+(-inits '(1)) ;; => '(nil (1))
```
#### -tails `(list)`
-Return all non-empty suffixes of `list`
+Return all suffixes of `list`
```el
-(-tails '(1 2 3 4)) ;; => '((1 2 3 4) (2 3 4) (3 4) (4))
-(-tails nil) ;; => nil
-(-tails '(1)) ;; => '((1))
+(-tails '(1 2 3 4)) ;; => '((1 2 3 4) (2 3 4) (3 4) (4) nil)
+(-tails nil) ;; => '(nil)
+(-tails '(1)) ;; => '((1) nil)
```
#### -distinct `(list)`
diff --git a/dash.texi b/dash.texi
index ece320c..e0737a7 100644
--- a/dash.texi
+++ b/dash.texi
@@ -1180,6 +1180,102 @@ See also: @code{-reduce-r-from}
(@pxref{-reduce-r-from}), @code{-reduce} (@pxref
@end example
@end defun
+@anchor{-reductions-from}
+@defun -reductions-from (fn init list)
+Return a list of the intermediate values of the reduction.
+
+See @code{-reduce-from} (@pxref{-reduce-from}) for explanation of the
arguments.
+
+See also: @code{-reductions} (@pxref{-reductions}), @code{-reductions-r}
(@pxref{-reductions-r}), @code{-reduce-r} (@pxref{-reduce-r})
+
+@example
+@group
+(-reductions-from (lambda (a i) (format "(%s FN %s)" a i)) "INIT" '(1 2 3 4))
+ @result{} '("INIT" "(INIT FN 1)" "((INIT FN 1) FN 2)" "(((INIT FN 1) FN 2)
FN 3)" "((((INIT FN 1) FN 2) FN 3) FN 4)")
+@end group
+@group
+(-reductions-from 'max 0 '(2 1 4 3))
+ @result{} '(0 2 2 4 4)
+@end group
+@group
+(-reductions-from '* 1 '(1 2 3 4))
+ @result{} '(1 1 2 6 24)
+@end group
+@end example
+@end defun
+
+@anchor{-reductions-r-from}
+@defun -reductions-r-from (fn init list)
+Return a list of the intermediate values of the reduction.
+
+See @code{-reduce-r-from} (@pxref{-reduce-r-from}) for explanation of the
arguments.
+
+See also: @code{-reductions-r} (@pxref{-reductions-r}), @code{-reductions}
(@pxref{-reductions}), @code{-reduce} (@pxref{-reduce})
+
+@example
+@group
+(-reductions-r-from (lambda (i a) (format "(%s FN %s)" i a)) "INIT" '(1 2 3 4))
+ @result{} '("(1 FN (2 FN (3 FN (4 FN INIT))))" "(2 FN (3 FN (4 FN INIT)))"
"(3 FN (4 FN INIT))" "(4 FN INIT)" "INIT")
+@end group
+@group
+(-reductions-r-from 'max 0 '(2 1 4 3))
+ @result{} '(4 4 4 3 0)
+@end group
+@group
+(-reductions-r-from '* 1 '(1 2 3 4))
+ @result{} '(24 24 12 4 1)
+@end group
+@end example
+@end defun
+
+@anchor{-reductions}
+@defun -reductions (fn list)
+Return a list of the intermediate values of the reduction.
+
+See @code{-reduce} (@pxref{-reduce}) for explanation of the arguments.
+
+See also: @code{-reductions-from} (@pxref{-reductions-from}),
@code{-reductions-r} (@pxref{-reductions-r}), @code{-reduce-r}
(@pxref{-reduce-r})
+
+@example
+@group
+(-reductions (lambda (a i) (format "(%s FN %s)" a i)) '(1 2 3 4))
+ @result{} '(1 "(1 FN 2)" "((1 FN 2) FN 3)" "(((1 FN 2) FN 3) FN 4)")
+@end group
+@group
+(-reductions '+ '(1 2 3 4))
+ @result{} '(1 3 6 10)
+@end group
+@group
+(-reductions '* '(1 2 3 4))
+ @result{} '(1 2 6 24)
+@end group
+@end example
+@end defun
+
+@anchor{-reductions-r}
+@defun -reductions-r (fn list)
+Return a list of the intermediate values of the reduction.
+
+See @code{-reduce-r} (@pxref{-reduce-r}) for explanation of the arguments.
+
+See also: @code{-reductions-r-from} (@pxref{-reductions-r-from}),
@code{-reductions} (@pxref{-reductions}), @code{-reduce} (@pxref{-reduce})
+
+@example
+@group
+(-reductions-r (lambda (i a) (format "(%s FN %s)" i a)) '(1 2 3 4))
+ @result{} '("(1 FN (2 FN (3 FN 4)))" "(2 FN (3 FN 4))" "(3 FN 4)" 4)
+@end group
+@group
+(-reductions-r '+ '(1 2 3 4))
+ @result{} '(10 9 7 4)
+@end group
+@group
+(-reductions-r '* '(1 2 3 4))
+ @result{} '(24 24 12 4)
+@end group
+@end example
+@end defun
+
@anchor{-count}
@defun -count (pred list)
Counts the number of items in @var{list} where (@var{pred} item) is non-nil.
@@ -1220,18 +1316,20 @@ Return the sum of @var{list}.
@defun -running-sum (list)
Return a list with running sums of items in @var{list}.
+@var{list} must be non-empty.
+
@example
@group
-(-running-sum '())
- @result{} nil
+(-running-sum '(1 2 3 4))
+ @result{} '(1 3 6 10)
@end group
@group
(-running-sum '(1))
@result{} '(1)
@end group
@group
-(-running-sum '(1 2 3 4))
- @result{} '(1 3 6 10)
+(-running-sum '())
+ @result{} error
@end group
@end example
@end defun
@@ -1260,18 +1358,20 @@ Return the product of @var{list}.
@defun -running-product (list)
Return a list with running products of items in @var{list}.
+@var{list} must be non-empty.
+
@example
@group
-(-running-product '())
- @result{} nil
+(-running-product '(1 2 3 4))
+ @result{} '(1 2 6 24)
@end group
@group
(-running-product '(1))
@result{} '(1)
@end group
@group
-(-running-product '(1 2 3 4))
- @result{} '(1 2 6 24)
+(-running-product '())
+ @result{} error
@end group
@end example
@end defun
@@ -2251,40 +2351,40 @@ Return the permutations of @var{list}.
@anchor{-inits}
@defun -inits (list)
-Return all non-empty prefixes of @var{list}.
+Return all prefixes of @var{list}.
@example
@group
(-inits '(1 2 3 4))
- @result{} '((1) (1 2) (1 2 3) (1 2 3 4))
+ @result{} '(nil (1) (1 2) (1 2 3) (1 2 3 4))
@end group
@group
(-inits nil)
- @result{} nil
+ @result{} '(nil)
@end group
@group
(-inits '(1))
- @result{} '((1))
+ @result{} '(nil (1))
@end group
@end example
@end defun
@anchor{-tails}
@defun -tails (list)
-Return all non-empty suffixes of @var{list}
+Return all suffixes of @var{list}
@example
@group
(-tails '(1 2 3 4))
- @result{} '((1 2 3 4) (2 3 4) (3 4) (4))
+ @result{} '((1 2 3 4) (2 3 4) (3 4) (4) nil)
@end group
@group
(-tails nil)
- @result{} nil
+ @result{} '(nil)
@end group
@group
(-tails '(1))
- @result{} '((1))
+ @result{} '((1) nil)
@end group
@end example
@end defun
- [elpa] externals/dash 2758ee7 130/316: Alias `-cons-pair-p` to `-cons-pair?`, (continued)
- [elpa] externals/dash 2758ee7 130/316: Alias `-cons-pair-p` to `-cons-pair?`, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7267556 075/316: Fix infinite loop in -zip/-interleave when called with no arguments., ELPA Syncer, 2021/02/15
- [elpa] externals/dash fd5980e 136/316: Ensure `hash?` expander evaluates its arg only once., ELPA Syncer, 2021/02/15
- [elpa] externals/dash dca7bdc 135/316: Merge pull request #277 from yyoncho/custom-destructoring, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7854ec7 148/316: Fix quote simplification in docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4ce0e85 149/316: Actually remove mentions of Marmalade, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0273913 072/316: Update docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e9b8611 077/316: Mention that -select and -remove are related, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8ef3287 078/316: Merge pull request #237 from Wilfred/add-see-also, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 55d8cc9 088/316: Running sum and product can only be computed from non-empty lists, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1b9061c 090/316: Update docs,
ELPA Syncer <=
- [elpa] externals/dash 528e5a5 095/316: Merge pull request #258 from Wilfred/quotes-in-docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash c77644b 092/316: Regenerate docs, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 27c2fe8 100/316: Add missing keywords, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 83190a2 106/316: Emacs 26.1 was released and pretest does no longer exist, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0505f5d 109/316: Merge pull request #271 from magnars/feature/-setq, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 148404c 114/316: [Fix #256] Allow `-let` bindings with no explicit value, ELPA Syncer, 2021/02/15
- [elpa] externals/dash f1ffdf7 131/316: Merge pull request #288 from cireu/master, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6d2decb 122/316: Prefer number-to-string over int-to-string, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3f7bc26 132/316: Provided option to extend destructoring, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a6e1436 124/316: Add -common-suffix, ELPA Syncer, 2021/02/15