Skip to content

Don't declare and <-> or as complements - #26

Open
dawehner wants to merge 2 commits into
ramda:masterfrom
dawehner:dawehner-patch-1
Open

Don't declare and <-> or as complements#26
dawehner wants to merge 2 commits into
ramda:masterfrom
dawehner:dawehner-patch-1

Conversation

@dawehner

@dawehner dawehner commented Jun 9, 2019

Copy link
Copy Markdown

I tried to add nand as function to ramda-adjunct, see char0n/ramda-adjunct#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?

@haskellcamargo

Copy link
Copy Markdown
Member

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-io

codecov-io commented Jun 18, 2019

Copy link
Copy Markdown

Codecov Report

Merging #26 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #26   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          27     27           
  Lines         249    249           
=====================================
  Hits          249    249
Impacted Files Coverage Δ
rules/complement-simplification.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e3d75d...3618c7b. Read the comment docs.

@dawehner
dawehner force-pushed the dawehner-patch-1 branch 2 times, most recently from f996777 to 6bf8259 Compare June 18, 2019 07:31
@dawehner

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants