main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
791 bytes
|
Line | |
---|
1 | var lift =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./lift.js");
|
---|
4 |
|
---|
5 | var not =
|
---|
6 | /*#__PURE__*/
|
---|
7 | require("./not.js");
|
---|
8 | /**
|
---|
9 | * Takes a function `f` and returns a function `g` such that if called with the same arguments
|
---|
10 | * when `f` returns a "truthy" value, `g` returns `false` and when `f` returns a "falsy" value `g` returns `true`.
|
---|
11 | *
|
---|
12 | * `R.complement` may be applied to any functor
|
---|
13 | *
|
---|
14 | * @func
|
---|
15 | * @memberOf R
|
---|
16 | * @since v0.12.0
|
---|
17 | * @category Logic
|
---|
18 | * @sig (*... -> *) -> (*... -> Boolean)
|
---|
19 | * @param {Function} f
|
---|
20 | * @return {Function}
|
---|
21 | * @see R.not
|
---|
22 | * @example
|
---|
23 | *
|
---|
24 | * const isNotNil = R.complement(R.isNil);
|
---|
25 | * R.isNil(null); //=> true
|
---|
26 | * isNotNil(null); //=> false
|
---|
27 | * R.isNil(7); //=> false
|
---|
28 | * isNotNil(7); //=> true
|
---|
29 | */
|
---|
30 |
|
---|
31 |
|
---|
32 | var complement =
|
---|
33 | /*#__PURE__*/
|
---|
34 | lift(not);
|
---|
35 | module.exports = complement; |
---|
Note:
See
TracBrowser
for help on using the repository browser.