These are chat archives for ramda/ramda

26th
Sep 2016
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 12:40
hi everybody, is there a method or a simple way to partially apply an argument at a given position? e.g. we have (a, b, c) => ... and we want to apply b before a and c
Denis Stoyanov
@xgrommx
Sep 26 2016 12:41
@ArnaudBertrand curry?
@ArnaudBertrand or http://ramdajs.com/docs/#__
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 12:45
Taking the doc example
var greet = (salutation, title, firstName) => salutation + ', ' + title + ' ' + firstName + '!';
I thought maybe there would be a function such as:
var greetWithTitle = partialN(greet, 1, ['Mr.s'])
Aaron Mc Adam
@aaronmcadam
Sep 26 2016 12:47
partialRight can be useful too
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 12:48
yes but partial right start from the last bit
I just want at a special given position
Aaron Mc Adam
@aaronmcadam
Sep 26 2016 12:48
yea
I wonder if flip would be useful at all
Might be quite messy though
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 12:50
flip would help, but only if it is the second argument
Aaron Mc Adam
@aaronmcadam
Sep 26 2016 12:50
Can you use __ with curry?
Sorry I'm just thinking outloud here, I don't know the solution really
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 12:51
It seems to be the best option
Markus Pfundstein
@MarkusPfundstein
Sep 26 2016 12:53
@ArnaudBertrand use placeholders e.g. R._
Aaron Mc Adam
@aaronmcadam
Sep 26 2016 12:54
@ArnaudBertrand https://goo.gl/XKmgTx
Arnaud Bertrand
@ArnaudBertrand
Sep 26 2016 13:35
thanks markus, this is the way I would probably go. aaron, you did the opposite of what I wanted.
If you want to have a better view of what I would have expected to exist you can have a look at this https://goo.gl/ndl97L
Denis Stoyanov
@xgrommx
Sep 26 2016 14:55
:smile: I have provided info about R.__ earlier
Juan Soto
@sotojuan
Sep 26 2016 20:34
some days ago i had a nice chat about futures vs promises in this chat, i wanted to mention i released a node http client that returns futures: https://github.com/sotojuan/fugot
LeonineKing1199
@LeonineKing1199
Sep 26 2016 20:48
Ha! Nice.
I still stand by my point though, the monadic interface makes more sense in a language that can enforce types.
Markus Pfundstein
@MarkusPfundstein
Sep 26 2016 20:49
makes more sense doesn’t mean it doesn’t make sense though
LeonineKing1199
@LeonineKing1199
Sep 26 2016 20:50
XD
Brad Compton (he/him)
@Bradcomp
Sep 26 2016 21:41
@sotojuan I saw that last night. Nice! Looking forward to trying it out.