## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jan 31 2019 22:17
CrossEye commented #2779
• Jan 31 2019 21:04
ArturAralin commented #2779
• Jan 31 2019 20:08
CrossEye commented #2779
• Jan 31 2019 18:56
buzzdecafe commented #2631
• Jan 31 2019 18:09
ArturAralin commented #2779
• Jan 31 2019 16:18
CrossEye commented #2779
• Jan 31 2019 16:10
CrossEye commented #2631
• Jan 31 2019 16:06
CrossEye commented #2777
• Jan 31 2019 14:44
ArturAralin opened #2779
• Jan 31 2019 07:39
inferusvv commented #2631
• Jan 31 2019 03:07
sespinozj commented #2771
• Jan 31 2019 02:33
• Jan 31 2019 02:26
JeffreyChan commented #2777
• Jan 30 2019 14:30
CrossEye closed #2777
• Jan 30 2019 12:13
• Jan 30 2019 01:42
JeffreyChan commented #2777
• Jan 29 2019 21:06
• Jan 29 2019 16:28
CrossEye commented #2777
• Jan 29 2019 15:50
mbostock commented #2772
• Jan 29 2019 15:48
CrossEye commented #2772
Ian Hofmann-Hicks
@evilsoft
Personally I find the placholders a little less readable than using combinators like flip which provide descriptive names for how the combinator acts on the functions. But I think it is really just a taste thing.
Charles Hughes
@chughes87
Yeah I could go either way in this case. I think for functions that take 3+ arguments though there is little choice
Ian Hofmann-Hicks
@evilsoft
also would that x need to be provided, like const fn = x => R.prop(R._, x). and that would loose the nice auto curry that flip would of provided. so you would probably wanna wrap that in an R.curry
Charles Hughes
@chughes87
yah good point
wangzengdi
what's other purpose of internal api _arity, except for limiting arguments'length to less than or equals to 10
for being easy to curry the function returned by other functions ?such as compose and pipe
Long Dao
@longebane
Awww yeah
Ian Hofmann-Hicks
@evilsoft
:wave: @longebane how the heck are ya
kapilpipaliya
@kapilpipaliya
onDestroy(() => { service.send('DESTROY'); });
how can i write this in ramda?
Twizzes
@Twizzes
@kapilpipaliya what are you trying to do
ramda isn't really a language, but more of a utility belt
and in that example, I don't see anything that could take advantage of ramda without seeing more context
kapilpipaliya
@kapilpipaliya
thanks
dattran1232003
@dattran1232003
Hey, I have one idea.
What if we could do this:
const appendLeft = (arr) => {}
dattran1232003
@dattran1232003
Const appendLeft = (elm, arr) => R.append(elm, arr.reverse()).reverse()
What is the difference between appendLeft and R.prepend?
dattran1232003
@dattran1232003
Is it exists?
Oh i don't no, sorry hehe
No prob! Happy to help :smile:
Pierre-Antoine Mills
@millsp

Hi all!

I come here to ask you what do you think is the best way to reduce two lists at once?

Supposing that the two lists are exactly the same length, how could I reduce over list1, access the current item (with index usually) and get the value at that same index in list2.

In plain JS, I would usually use the indexfrom the callback, but it see that ramda works differently. I'd like to What do you think?

Rob Grant
@robgrant
zip first, then reduce
mitcho

someone told me a good practice for composing sorter functions is that if they return 0 it delegates to the next function, i defined this as

const pipeCritera = (...fns) => (a, b) => (fns.find(f => f(a, b) !== 0) || (() => 0))(a, b);

essentially returning the value of the first sorting function that doesnt return 0,

now im wondering if ramda already has this covered

Pierre-Antoine Mills
@millsp
@robgrant this could double the iteration time on very long lists. Wouldn't it be wiser to have the index provided by the reducer, in that case of repeated operations/long lists?
Ben Briggs
@ben-eb
@mitchoSR_twitter @pirix-gh Probably better to do this with reduce, here's one such implementation: https://stackoverflow.com/a/55990011
mitcho
ahh cool, thats a bit cleaner
thanks ben
What about R.sortWith?
mitcho
bingo
ty ramda tour guides XD
:bowtie:
Long Dao
@longebane
@evilsoft when you said javascript started out as a FP language, what did you mean?
Ian Hofmann-Hicks
@evilsoft
As I understand it, when it was being created, it was intended to be a LISP dialect, but near the end of development he added features like prototypical inheritance, this and other bit to make it more Java-like. That is why, from my understanding things like closure scope and first class functions are at the core. Which are the only (2) features that are required to be a functional language
Trying to track down my sources, one was an interview with Brendan Eich and another was a book. Gonna see if I can hunt those down and post them here
I think I read the same interview
He said that it was really important that first class functions were included.
Ian Hofmann-Hicks
@evilsoft
Spcifically a Scheme Lisp I think, gosh darn it, it is a lot harder to find the original material then it was 4 years ago
Long Dao
@longebane
Asking because I'm about to teach a js fundamentals course and my lesson plan keeps telling me to state JS started as and is an OOP language
and unless I can argue against that myself, I'll have to say that