These are chat archives for ramda/ramda

18th
Dec 2014
Jethro Larson
@jethrolarson
Dec 18 2014 00:21
R.map = _curry2(_checkForMethod('map', _map))
So this checks if the passed function has a .map, right?
So then for lenses you can do map(myLens, fn, myOb), right?
Michael Hurley
@buzzdecafe
Dec 18 2014 00:53
yes, but ...
lens map takes two args
Scott Sauyet
@CrossEye
Dec 18 2014 00:53
the passed object, really
Michael Hurley
@buzzdecafe
Dec 18 2014 00:53
so i don't think the dispatch will work
Scott Sauyet
@CrossEye
Dec 18 2014 01:00
it dispatches on the last parameter, not the first.
I guess I don't see why it wouldn't dispatch properly.
Michael Hurley
@buzzdecafe
Dec 18 2014 01:01
because dispatch will call obj.map(f)
and lens.map needs (f, x)
Scott Sauyet
@CrossEye
Dec 18 2014 01:12
yes, of course. And you said that several messages back.
Michael Hurley
@buzzdecafe
Dec 18 2014 01:17
that has bothered me from the beginning. but i don't see a simple solution for it.
Scott Sauyet
@CrossEye
Dec 18 2014 01:18
Actually, checkForMethod would be perfectly willing to call (f, x), but curry2 is interfering.
Michael Hurley
@buzzdecafe
Dec 18 2014 01:20
arg
pardon the pun
Scott Sauyet
@CrossEye
Dec 18 2014 01:26
Wonder if it would break anything for the curries to pass all additional parameters along in their all-parameters cases.
Michael Hurley
@buzzdecafe
Dec 18 2014 01:27
i was afraid you were going to say that :worried:
idk, but it makes curry a bit dirtier
Scott Sauyet
@CrossEye
Dec 18 2014 01:55
Yeah, I'm not even going to try it now. It's not just that it's dirtier, it's also likely to be less performant.
Scott Sauyet
@CrossEye
Dec 18 2014 02:01
All right, back down to a more reasonable number of downloads. 668 yesterday. Still the second highest ever, but more in line with recent numbers than yesterday's anomalous 6K+.
Jethro Larson
@jethrolarson
Dec 18 2014 18:19
darn mylens.map(fn, x) looks less idiomatic
Jethro Larson
@jethrolarson
Dec 18 2014 18:41
I guess map(mylens.map(fn), x) would work but that's not better
Jethro Larson
@jethrolarson
Dec 18 2014 18:48
map(fn, mylens) would call lens.map but with no obj. hmm.
Michael Hurley
@buzzdecafe
Dec 18 2014 21:32
exactly.
unless you wrap the object in closure. but that is nasty too
Jethro Larson
@jethrolarson
Dec 18 2014 22:41
I see in the source:
case 1: return function(a0) {void a0; return fn.apply(this, arguments);};
What does void do in that context? Looking at MDN it just evaluates an expression then returns undefined. So that would basically do nothing...
David Chambers
@davidchambers
Dec 18 2014 22:46
That's right. It's just there to appease the linter.
Otherwise we'd have an unreferenced identifier.