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

nand #237

Closed
char0n opened this issue Dec 9, 2017 · 6 comments
Closed

nand #237

char0n opened this issue Dec 9, 2017 · 6 comments

Comments

@char0n
Copy link
Owner

char0n commented Dec 9, 2017

export const nand = complement(and);
@char0n char0n mentioned this issue Dec 9, 2017
1 task
@char0n char0n self-assigned this Dec 9, 2017
@char0n
Copy link
Owner Author

char0n commented Dec 9, 2017

@Undistraction

and in ramda is defined with Hindley-Milner signature a → b → a | b
This means that and can process any types, not just Booleans and can return any types.

Example of what I mean

R.and(1, 2); // => 2
R.and("test", "test1"); // => "test1"

Keeping this in mind, if we implement nand as complement of and it will always return Boolean.
The signature be then a → b → Boolean

Are we okay with that ? Does any usecase for this exist ?

@BjornMelgaard any opinion on this ?

@srghma
Copy link
Collaborator

srghma commented Dec 9, 2017

@char0n
What we should return otherwise? first parameter? there is or for this
I think its fine to return boolean and be closer to ramda as possible

@char0n
Copy link
Owner Author

char0n commented Dec 9, 2017

@BjornMelgaard the question was rather, do we need something like this in the lib ? ... rather then what it should return. It can return Boolean, and Boolean only,

@srghma
Copy link
Collaborator

srghma commented Dec 9, 2017

@char0n if someone wants to, I've never used complement of and, I would rather add complement of path and prop

@Undistraction
Copy link
Collaborator

Complement of Ramda's and.

  • T T = F
  • T F = T
  • F T = T
  • F F = T

See: #234

@dawehner
Copy link
Contributor

dawehner commented Jun 9, 2019

This is implemented in #952

@char0n char0n closed this as completed in 7931fa0 Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants