These are chat archives for ramda/ramda

17th
Oct 2016
Ryan Zeigler
@rzeigler
Oct 17 2016 02:25
Did I recall that someone here had an alternate typings file for ramda that they used?
Markus Pfundstein
@MarkusPfundstein
Oct 17 2016 07:23
@LeonineKing1199 which LTS? Node6 LTS is out since June or so
Ryan Zeigler
@rzeigler
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.
hkrutzer
@hkrutzer
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
@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
hkrutzer
@hkrutzer
Oct 17 2016 13:19
no I have fromFormat1toFormat2 :: format1 -> format2 and don't want to implement fromFormat2toFormat1 :smile:
Irakli Safareli
@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
LeonineKing1199
@LeonineKing1199
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)
@Bradcomp
Oct 17 2016 15:04

which LTS? Node6 LTS is out since June or so

Node 6 goes to LTS tomorrow

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