Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dawehner
Copy link

@dawehner dawehner commented Jun 9, 2019

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
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
Copy link

codecov-io commented Jun 18, 2019

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