These are chat archives for ramda/ramda

6th
Dec 2014
Michael Hurley
@buzzdecafe
Dec 06 2014 16:40
someone set up a twitter account for ramda: https://twitter.com/ramdajs
i know nothing about this. anybody?
David Chambers
@davidchambers
Dec 06 2014 16:43
That's news to me.
Michael Hurley
@buzzdecafe
Dec 06 2014 17:13
seems to just be a bot retweeting #ramda tagged stuff
David Chambers
@davidchambers
Dec 06 2014 17:41
Lots of positive comments. :)
Raine Virta
@raine
Dec 06 2014 17:41
is there a method for x == null in ramda?
err.. function
David Chambers
@davidchambers
Dec 06 2014 17:41
No, but I wish there were!
function(x) { return x == null; }
R.or(R.eq(null), R.eq(undefined))
Raine Virta
@raine
Dec 06 2014 17:43
existy?
David Chambers
@davidchambers
Dec 06 2014 17:43
These are both ugly to my eye. The problem is, what would one name such a function?
R.exists?
R.nullish?
R.nonexistent?
R.exists = function exists(x) { return x != null; };
R.filter(R.exists, [1, 2, null, 4, undefined, undefined, 7]);  // => [1, 2, 4, 7]
Michael Hurley
@buzzdecafe
Dec 06 2014 18:58
eqnull?
Michael Hurley
@buzzdecafe
Dec 06 2014 19:04
blank?
nothing?
mu?
isNil?
Michael Hurley
@buzzdecafe
Dec 06 2014 19:29
ramda/ramda#666
The pull request of the beast
Raine Virta
@raine
Dec 06 2014 20:02
cool
David Chambers
@davidchambers
Dec 06 2014 20:07
That's responsive!
Michael Hurley
@buzzdecafe
Dec 06 2014 20:08
gotta pick the low-hanging fruit before you grab it @davidchambers :stuck_out_tongue:
David Chambers
@davidchambers
Dec 06 2014 20:10
R.inc(Number(beast)): ramda/ramda#667
Raine Virta
@raine
Dec 06 2014 20:12
those are succ and pred in haskell
in clojure those i think
Michael Hurley
@buzzdecafe
Dec 06 2014 20:15
we are only doing half of haskell
David Chambers
@davidchambers
Dec 06 2014 20:26
I'd like to add this function: R.xxx = xxx(n) { return -n; };. What's the appropriate value for xxx? I was thinking "negate", but having read about negation on Wikipedia I've learnt that term applies to logical negation (i.e. !n). What's the term for changing a number's sign? Google is failing me.
Actually, it appears negate is the right word. It is used in both contexts.
Michael Hurley
@buzzdecafe
Dec 06 2014 20:38
seems like classic negation to me
negate goes into zany javascript land
!!(-(false)) //=> false
Michael Hurley
@buzzdecafe
Dec 06 2014 20:46
This message was deleted
Michael Hurley
@buzzdecafe
Dec 06 2014 20:51
another possible name for negate is inverseOf
David Chambers
@davidchambers
Dec 06 2014 21:01
Yes, or invert.
I'll open a PR for discussion.
We just added a function named invert! >.<
Michael Hurley
@buzzdecafe
Dec 06 2014 21:04
we love discussion
Michael Hurley
@buzzdecafe
Dec 06 2014 22:20
i thought we had a logical negation, but we don't. not negates the output of the function you give it, not a (boolean) value
David Chambers
@davidchambers
Dec 06 2014 22:23
I could get behind renaming R.not R.complement, and adding R.not = function not(x) { return !x; };.
Michael Hurley
@buzzdecafe
Dec 06 2014 22:25
SGTM