These are chat archives for ramda/ramda

21st
Jul 2016
Aldwin Vlasblom
@Avaq
Jul 21 2016 09:23 UTC
@JAForbes Not that I know of. :)
Tushar Mathur
@tusharmath
Jul 21 2016 18:51 UTC
Is there a way i can quickly create a combinator function via ramda?
like is I have an array of 10 elements and I want to select five out of them
giving us a total of 252 combinations.
?
Gabe Johnson
@gabejohnson
Jul 21 2016 19:06 UTC
@tusharmath can you pseudo code it?
Tushar Mathur
@tusharmath
Jul 21 2016 19:07 UTC
Its going to be really long ...
Gabe Johnson
@gabejohnson
Jul 21 2016 19:07 UTC
just give me the usage
input and expected output
you can elide
Tushar Mathur
@tusharmath
Jul 21 2016 19:08 UTC

combinations(2, [1, 2, 3])  
/*
 OUTPUTS: 
 [1, 2]
 [2, 3]
 [3, 1]
*/
Gabe Johnson
@gabejohnson
Jul 21 2016 19:09 UTC
ahhh
get it
@tusharmath do the values in the list have to be unique?
Tushar Mathur
@tusharmath
Jul 21 2016 19:14 UTC
This message was deleted
you mean the input or output ?
Gabe Johnson
@gabejohnson
Jul 21 2016 19:14 UTC
input
Tushar Mathur
@tusharmath
Jul 21 2016 19:15 UTC
well that would be a special case to handle
I mean ... atleast for what I am looking for right now , they are unique
if that helps.
Tushar Mathur
@tusharmath
Jul 21 2016 19:38 UTC
@gabejohnson any idea ?
Gabe Johnson
@gabejohnson
Jul 21 2016 19:40 UTC
a couple of reduces and a uniq
Tushar Mathur
@tusharmath
Jul 21 2016 19:42 UTC
ok let me try