[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 86de963 217/439: Add docs about require for dash-f
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash 86de963 217/439: Add docs about require for dash-functional |
Date: |
Tue, 04 Aug 2015 20:28:10 +0000 |
branch: externals/dash
commit 86de963a80569b907264d4b077437d28f2fadc2a
Author: Magnar Sveen <address@hidden>
Commit: Magnar Sveen <address@hidden>
Add docs about require for dash-functional
---
README.md | 14 ++++++++++++++
dash-functional.el | 28 +++++++++++++++++++++-------
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index d24bf99..6261ac6 100644
--- a/README.md
+++ b/README.md
@@ -935,6 +935,8 @@ results (in the same order).
In types: (b -> b -> c) -> (a -> b) -> a -> a -> c
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(-sort (-on '< 'length) '((1 2 3) (1) (1 2))) ;; => '((1) (1 2) (1 2 3))
(-sort (-on 'string-lessp 'int-to-string) '(10 12 1 2 22)) ;; => '(1 10 12 2
22)
@@ -947,6 +949,8 @@ Swap the order of arguments for binary function `func`.
In types: (a -> b -> c) -> b -> a -> c
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(funcall (-flip '<) 2 1) ;; => t
(funcall (-flip '-) 3 8) ;; => 5
@@ -959,6 +963,8 @@ Return a function that returns `c` ignoring any additional
arguments.
In types: a -> b -> a
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(funcall (-const 2) 1 3 "foo") ;; => 2
(-map (-const 1) '("a" "b" "c" "d")) ;; => '(1 1 1 1)
@@ -972,6 +978,8 @@ Arguments denoted by <> will be left unspecialized.
See `srfi-26` for detailed description.
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(funcall (-cut list 1 <> 3 <> 5) 2 4) ;; => '(1 2 3 4 5)
(-map (-cut funcall <> 5) '(1+ 1- (lambda (x) (/ 1.0 x)))) ;; => '(6 4 0.2)
@@ -984,6 +992,8 @@ Take an unary predicates `pred` and return an unary
predicate
that returns t if `pred` returns nil and nil if `pred` returns
non-nil.
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(funcall (-not 'even?) 5) ;; => t
(-filter (-not (-partial '< 4)) '(1 2 3 4 5 6 7 8)) ;; => '(1 2 3 4)
@@ -997,6 +1007,8 @@ the `preds` returns non-nil on x.
In types: [a -> Bool] -> a -> Bool
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(-filter (-orfn 'even? (-partial (-flip '<) 5)) '(1 2 3 4 5 6 7 8 9 10)) ;; =>
'(1 2 3 4 6 8 10)
(funcall (-orfn 'stringp 'even?) "foo") ;; => t
@@ -1010,6 +1022,8 @@ predicate with argument x that returns non-nil if all of
the
In types: [a -> Bool] -> a -> Bool
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher.
+
```cl
(funcall (-andfn (-cut < <> 10) 'even?) 6) ;; => t
(funcall (-andfn (-cut < <> 10) 'even?) 12) ;; => nil
diff --git a/dash-functional.el b/dash-functional.el
index 0770d72..d7e70bf 100644
--- a/dash-functional.el
+++ b/dash-functional.el
@@ -64,26 +64,34 @@ expects a list with n items as arguments"
TRANSFORMER to each of them and then applies OPERATOR on the
results (in the same order).
-In types: (b -> b -> c) -> (a -> b) -> a -> a -> c"
+In types: (b -> b -> c) -> (a -> b) -> a -> a -> c
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (x y) (funcall operator (funcall transformer x) (funcall transformer
y))))
(defun -flip (func)
"Swap the order of arguments for binary function FUNC.
-In types: (a -> b -> c) -> b -> a -> c"
+In types: (a -> b -> c) -> b -> a -> c
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (x y) (funcall func y x)))
(defun -const (c)
"Return a function that returns C ignoring any additional arguments.
-In types: a -> b -> a"
+In types: a -> b -> a
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (&rest args) c))
(defmacro -cut (&rest params)
"Take n-ary function and n arguments and specialize some of them.
Arguments denoted by <> will be left unspecialized.
-See SRFI-26 for detailed description."
+See SRFI-26 for detailed description.
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(let* ((i 0)
(args (mapcar (lambda (x) (setq i (1+ i)) (make-symbol (format "D%d"
i)))
(-filter (-partial 'eq '<>) params))))
@@ -93,7 +101,9 @@ See SRFI-26 for detailed description."
(defun -not (pred)
"Take an unary predicates PRED and return an unary predicate
that returns t if PRED returns nil and nil if PRED returns
-non-nil."
+non-nil.
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (x) (not (funcall pred x))))
(defun -orfn (&rest preds)
@@ -101,7 +111,9 @@ non-nil."
predicate with argument x that returns non-nil if at least one of
the PREDS returns non-nil on x.
-In types: [a -> Bool] -> a -> Bool"
+In types: [a -> Bool] -> a -> Bool
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (x) (-any? (-cut funcall <> x) preds)))
(defun -andfn (&rest preds)
@@ -109,7 +121,9 @@ In types: [a -> Bool] -> a -> Bool"
predicate with argument x that returns non-nil if all of the
PREDS returns non-nil on x.
-In types: [a -> Bool] -> a -> Bool"
+In types: [a -> Bool] -> a -> Bool
+
+Available by `(require 'dash-functional)`. Requires Emacs 24 or higher."
(lambda (x) (-all? (-cut funcall <> x) preds)))
(provide 'dash-functional)
- [elpa] externals/dash d1913c6 210/439: Merge pull request #41 from Wilfred/master, (continued)
- [elpa] externals/dash d1913c6 210/439: Merge pull request #41 from Wilfred/master, Phillip Lord, 2015/08/04
- [elpa] externals/dash 506401e 203/439: Merge pull request #39 from Fuco1/rotate, Phillip Lord, 2015/08/04
- [elpa] externals/dash 37064b5 213/439: Include @Fuco1 in Authors/Copyright + fix README, Phillip Lord, 2015/08/04
- [elpa] externals/dash d6ca7d9 215/439: Fix E23 bug and re-enable E23 CI, Phillip Lord, 2015/08/04
- [elpa] externals/dash 51c9f6b 212/439: Merge pull request #42 from Fuco1/functional, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9abae5e 211/439: Add combinators, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9a149bf 219/439: Add anaphoric example to --max-by and --min-by, Phillip Lord, 2015/08/04
- [elpa] externals/dash d374fcc 214/439: Revert "Add combinators", Phillip Lord, 2015/08/04
- [elpa] externals/dash 2a7fbdc 218/439: Update -max-by & friends, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6911514 221/439: Update docs too, Phillip Lord, 2015/08/04
- [elpa] externals/dash 86de963 217/439: Add docs about require for dash-functional,
Phillip Lord <=
- [elpa] externals/dash 4a144c6 220/439: Release 2.0.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9b0166a 224/439: Fix terminology, Phillip Lord, 2015/08/04
- [elpa] externals/dash 6d0a8d6 225/439: Add Version and Package-Requires to files #45, Phillip Lord, 2015/08/04
- [elpa] externals/dash d365f22 222/439: Fix byte compile warnings, Phillip Lord, 2015/08/04
- [elpa] externals/dash 1812a17 226/439: Complete dash and dash-functional split, Phillip Lord, 2015/08/04
- [elpa] externals/dash f1049f1 216/439: Add dash-functional back, now dependent on dash.el, Phillip Lord, 2015/08/04
- [elpa] externals/dash 39d20f2 228/439: Release 2.0.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 81e43ad 229/439: Add -union to list of highlighted symbols., Phillip Lord, 2015/08/04
- [elpa] externals/dash 515e2d3 230/439: Use `comparator` instead of `predicate` for sort., Phillip Lord, 2015/08/04
- [elpa] externals/dash 6cc7727 234/439: Release 2.1.0, Phillip Lord, 2015/08/04