These are chat archives for ramda/ramda

Oct 2016
Ryan Zeigler
Oct 17 2016 02:25
Did I recall that someone here had an alternate typings file for ramda that they used?
Markus Pfundstein
Oct 17 2016 07:23
@LeonineKing1199 which LTS? Node6 LTS is out since June or so
Ryan Zeigler
Oct 17 2016 10:43
i feel like I read somewhere that node 6 wasn't LTS yet even though it was even. Something about only the final minor release in the series actually being LTS.
Oct 17 2016 12:29
if I have 2 data formats that can be converted into each other, is there a magical FP way of only writing one converter?
Irakli Safareli
Oct 17 2016 12:45

@hkrutzer If I understand it correctly you have w formats and function from one to other:

fromFormat1toFormat2 :: format1 -> format2
fromFormat2toFormat1 :: format2 -> format1

and you want to have

toFormat1 :: any -> format1
toFormat2 :: any  -> format2

Bot don't want implement both of them. if that's the case you can write toFormat1 and implement toFormat2 using composition of toFormat1 and fromFormat1toFormat2

toFormat1 = ...
toFormat2 = toFormat1 |> fromFormat1toFormat2
Oct 17 2016 13:19
no I have fromFormat1toFormat2 :: format1 -> format2 and don't want to implement fromFormat2toFormat1 :smile:
Irakli Safareli
Oct 17 2016 13:23
I think you cant just because you have fromFormat1toFormat2you cant get fromFormat2toFormat1without implementing it.
also i think if fromFormat2toFormat1(fromFormat1toFormat2(format1))) is equivalent to format1, then format1 and format2 are isomorphic
Oct 17 2016 14:51
There's a renameKeys function in the Ramda cookbook that might be what you're after.
Brad Compton (he/him)
Oct 17 2016 15:04

which LTS? Node6 LTS is out since June or so

Node 6 goes to LTS tomorrow

Oct 17 2016 21:04
Date satisfies Ord, right?
Like I can use R.min with Date-types, right?
Eh, #yolo