These are chat archives for ramda/ramda

18th
Feb 2015
Graeme Yeates
@megawac
Feb 18 2015 00:01
6to5 folks are suggesting us call it something along the lines of rest
Eero Saynatkari
@rue
Feb 18 2015 00:29
@megawac Do you have a use case in mind for the functionality? Makes it a little easier to see how names would fit in the picture. [un]spread would have the obvious es6 parallel. rest has some baggage from occasional interchangeability with tail
David Chambers
@davidchambers
Feb 18 2015 00:52
I like the name collect.
Scott Sauyet
@CrossEye
Feb 18 2015 00:58
:+1: for collect.
Eero Saynatkari
@rue
Feb 18 2015 01:13
Both _’s alias collect for map (not that that’s a blocker). Is collectArgs too unwieldy? Or maybe a variation of arity?
David Chambers
@davidchambers
Feb 18 2015 01:16
collect has never made sense to me as an alias for map. I don't see how [a] -> [a] involves collecting anything. I'd expect collect to have type a -> a -> a -> [a] or something like that.
Eero Saynatkari
@rue
Feb 18 2015 01:37
I think it’s a Rubyism. Collecting the result of functions, rather than a transform
Graeme Yeates
@megawac
Feb 18 2015 02:02
yeah, collect is a silly name but what can you do, its been there since the start
the use case is for stuff like this jashkenas/backbone#3489
Graeme Yeates
@megawac
Feb 18 2015 18:00
why do you guys build the dist/ramda.js every pr
makes the diffs so much harder to read
@CrossEye @davidchambers @buzzdecafe if ramda/ramda#819 is going in would you be interested in the collect method I was suggesting yesterday
I think we can make it sing for @davidchambers changes
going to try benchmarking it on underscore later for partial, feel like the same should apply here
David Chambers
@davidchambers
Feb 18 2015 18:23
I think we should switch to only updating dist/ramda.js when we publish.
I like the collect function you suggested yesterday.
Graeme Yeates
@megawac
Feb 18 2015 18:26
it actually is really ugly in implementation
ill ping you on a commit but if you use 6to5 it generates super nice code for the case :z
function rest(f) {
  return function(arg1, arg2, ...args) {
    return f(arg1, arg2, args);
  }  
}
6to5 ->
function rest(f) {
  return function (arg1, arg2) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }
    return f(arg1, arg2, args);
  };
}
David Chambers
@davidchambers
Feb 18 2015 18:39
The 6to5 compilation is nicer because it can hard-code the number of preceding arguments?
Graeme Yeates
@megawac
Feb 18 2015 18:52
yeah, and it knows if has to call apply or direct call
Scott Sauyet
@CrossEye
Feb 18 2015 23:47
@megawac: Removing the dist/ramda.js from local commits is definitely on my TODO list. But I still would like it included when pulling from Github. That would mean generating it and committing it in a post-build step in Travis, but there's a minor snag: we only want it committed when all the builds succeed. I don't know how to do that.
Scott Sauyet
@CrossEye
Feb 18 2015 23:53
Possible other name rather than collect: gather, which Reg Braithwaite credits to Kyle Simpson.