Don't declare and <-> or as complements
I tried to add nand as function to ramda-adjunct, see https://github.com/char0n/ramda-adjunct/issues/237. When I tried to do that, eslint-plugin-ramda complaint about complement(and) being replaceable by or.
This is strictly not true for one case:
R.or(false, false) -> false
R.complement(R.and(false, false)) -> true
Am I missing something?
Actually, complement(and(false, false)) evaluates to [undefined]. Ideally, complement should receive a predicate function and in this case it is receiving a value (the result of and(false, false), which eslint-plugin-ramda will force to become false && false). I believe you mean complement(and)(false, false). If it is that case, you are correct.
In order to merge your pull-request, I'll only ask you to remove the specific test for it (which is breaking the build).
Thank you!
Codecov Report
Merging #26 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #26 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 27 27
Lines 249 249
=====================================
Hits 249 249
| Impacted Files | Coverage Δ | |
|---|---|---|
| rules/complement-simplification.js | 100% <ø> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 2e3d75d...3618c7b. Read the comment docs.
Actually, complement(and(false, false)) evaluates to [undefined]. Ideally, complement should receive a predicate function and in this case it is receiving a value (the result of and(false, false), which eslint-plugin-ramda will force to become false && false). I believe you mean complement(and)(false, false). If it is that case, you are correct.
Oh, spot on. Thank you for pointing this out.
I've updated the test