These are chat archives for ramda/ramda

20th
Sep 2016
Denis Stoyanov
@xgrommx
Sep 20 2016 07:36
anyway also I like it http://danieltao.com/lazy.js/
Craig Dallimore
@craigdallimore
Sep 20 2016 13:53
const g = (x, y) => f(y)(x)

g(a, b)
Is there some nice way to make this pointfree? I've been messing around with flip and call yet what looks obvious isn't working out.
Denis Stoyanov
@xgrommx
Sep 20 2016 13:57
@craigdallimore what is f?
Craig Dallimore
@craigdallimore
Sep 20 2016 13:57
var f = setting => evolve({ settings : merge(__, setting) });
I'll get you the whole thing
Denis Stoyanov
@xgrommx
Sep 20 2016 13:59
@craigdallimore do u need g(a)(b)?
Craig Dallimore
@craigdallimore
Sep 20 2016 13:59
I'm after g(a, b) in this case
Denis Stoyanov
@xgrommx
Sep 20 2016 13:59
@craigdallimore var g = curryN(2, call(f))
Craig Dallimore
@craigdallimore
Sep 20 2016 14:00
!!!
Denis Stoyanov
@xgrommx
Sep 20 2016 14:00
why do u use call?
Craig Dallimore
@craigdallimore
Sep 20 2016 14:01
Ah hang on
I'm trying to get f :: b -> a -> a
and g :: a, b -> a
So I think there needs to be a flip in here
Craig Dallimore
@craigdallimore
Sep 20 2016 14:07
Got it
var g = flip(uncurryN(2, f))
Denis Stoyanov
@xgrommx
Sep 20 2016 14:07
@craigdallimore for first flip(always)
Craig Dallimore
@craigdallimore
Sep 20 2016 14:07
Thanks @xgrommx you put me on the right path
Ha neat
:D
Alastair Hole
@afhole
Sep 20 2016 14:21
Hey all - is there any easy way to trim spaces from just the beginning of a string, i.e. an ltrim
Alastair Hole
@afhole
Sep 20 2016 14:38
Hmm I guess replace(/^\s+/, '') is probably the best way
Francis
@FrancisVega
Sep 20 2016 14:40
Hi, I have a newbie question related with regexp and spaces..
Why this is false :S
R.split(/\s+/g, 'foo bar') === ["foo", "bar"]
Alastair Hole
@afhole
Sep 20 2016 14:44
Is it because === checks the array's identity, not its value?
["foo", "bar"] === ["foo", "bar"] //false
Francis
@FrancisVega
Sep 20 2016 14:45
with == also returl false :S
Craig Dallimore
@craigdallimore
Sep 20 2016 14:45
Perhaps use R.equals?
R.equals(['a'], ['a']) // true
Alastair Hole
@afhole
Sep 20 2016 14:45
equals(["foo", "bar"], ["foo", "bar"]) //true
Hah yeah what @craigdallimore said :)
Francis
@FrancisVega
Sep 20 2016 14:46
I'm using mocha for testing and assert.isEqual() return false too
oh! :D
Alastair Hole
@afhole
Sep 20 2016 14:46
Does mocha have a value comparison assertion?
Craig Dallimore
@craigdallimore
Sep 20 2016 14:47
assert(R.equals( ... )) perhaps?
Francis
@FrancisVega
Sep 20 2016 14:49
solved! :D
thanks so much
Barry G
@bgits
Sep 20 2016 15:33
@MarkusPfundstein in the updateByKey example you create yesterday, wondering if us and is variables are standard notation, if so what do they generally mean?
Barry G
@bgits
Sep 20 2016 16:14
btw, when I tested, the example throws an error: https://goo.gl/uUI8Xl
LeonineKing1199
@LeonineKing1199
Sep 20 2016 16:27
There's also assert.deepEqual
When it comes to objects, using === does a reference comparison which is basically comparing two pointers for equality in C (i.e. do these objects live at same location in memory space?)
Denis Stoyanov
@xgrommx
Sep 20 2016 16:31
@bgvianyc instead fork use useWith
Markus Pfundstein
@MarkusPfundstein
Sep 20 2016 16:31
@bgvianyc No, they are actually terribel variable names to be honest
Denis Stoyanov
@xgrommx
Sep 20 2016 16:33
@bgvianyc sorry, converge or lift
Markus Pfundstein
@MarkusPfundstein
Sep 20 2016 16:33
@bgvianyc the error is because I started the string with ‘ but ended with ` . Sorry for that.
useWith is nice btw
Denis Stoyanov
@xgrommx
Sep 20 2016 16:34
const fork = R.curry((f, a, b, v) => f(a(v), b(v)));

fork(add, add(10), add(20), 30)
converge(add, [add(10), add(20)])(30)
lift(add)(add(10), add(20))(30)
Markus Pfundstein
@MarkusPfundstein
Sep 20 2016 16:34
cool
I think fork is more clear tbh
but awesome functions. thx
Denis Stoyanov
@xgrommx
Sep 20 2016 16:35
This message was deleted
This message was deleted
LeonineKing1199
@LeonineKing1199
Sep 20 2016 22:10
I was looking in the api docs and I saw that allUniq was deprecated. Out of curiosity, why?
hkrutzer
@hkrutzer
Sep 20 2016 22:44
ramda/ramda#1622
LeonineKing1199
@LeonineKing1199
Sep 20 2016 22:48
Huh, I wonder how it gets decided what's cookbook material vs what's not.
If anything, the deprecation warning might include a note that it was moved to the cookbook.
Michael Hurley
@buzzdecafe
Sep 20 2016 23:50

I wonder how it gets decided what's cookbook material vs what's not.

someone suggests it and someone else agrees