loop-recur / lambdajs

143 stars 12 forks source link

Depend on Ramda instead of LoDash #6

Open cgarciae opened 10 years ago

cgarciae commented 10 years ago

Lamda currently depends on LoDash for the functions compose and curry, I propose to depend on Ramda instead. The reason: string representation of functions.

Currently the string representation of a higher order function is an anonymous function with some code unrelated to the function of interest. Example:

console.log (add (1)); // ==>
/*
function bound() {
    var thisBinding = isBind ? thisArg : this;
    if (partialArgs) {
      var args = slice(partialArgs);
...LOTS OF MORE UGLY STUFF...
*/

With Ramda instead you get:

console.log (add (1)); // ==>
/*
function ( x, y ) {
      return x + y;
    } 
/*
DrBoolean commented 10 years ago

And the fn.toString() trick comes full circle :)

I'm down, but i don't have time to do this for a little bit. Definitely will pull though.

cgarciae commented 10 years ago

Yeah, heard you mentioned on this trick. It wouldn't be right not to have it on your library ;)