These are chat archives for ramda/ramda

28th
Jan 2015
Jethro Larson
@jethrolarson
Jan 28 2015 00:51
Could foldl's fn be getting params in the wrong order? function(arr, v) seems inverted from a lot of the other functions. You'd think that foldl(append, []) would work as the base case. Sure you can use appendTo, but there's no assocTo or swapped versions of every function. Seems like the general pattern is that the data structure is the last param. Am I off base?
I guess with foldl(subtract, 100, [1, 2]), would be weird the other way. hmm.
Michael Hurley
@buzzdecafe
Jan 28 2015 02:05
interesting question--i think it has the accumulator, element parameter ordering because as you fold, the element is the data, i.e. the thing that keeps changing.
Ravi Varanasi
@RaviVaranasi
Jan 28 2015 02:49
Are there any good practical examples of lift and lens ?
Scott Sauyet
@CrossEye
Jan 28 2015 03:26
The fold(l|r) callback is an interesting question. There are a few functions that don't seem to have a clear-cut parameter order. This is one of those cases. Either order seems reasonable. So we have chosen to go with the common order of most languages.
Jethro Larson
@jethrolarson
Jan 28 2015 18:33

fair enough. So far I've been mostly using fold to convert from array to object or back so it seemed more useful for me to take the accumulator as the second. There's always R.flip :)

Also I noticed that the links to associated line numbers on the doc site are gone. I did use that to quickly look at how the functions worked. Can we get those back? We could hide them behind the drop-down to reduce noise.

Arian Stolwijk
@arian
Jan 28 2015 21:10
Hi, is there something that does this (using ES6 syntax): x => (_ => x)
so a function that returns a function that always returns x
Michael Hurley
@buzzdecafe
Jan 28 2015 21:53
@arian R.always
Arian Stolwijk
@arian
Jan 28 2015 23:28
ah, thanks @buzzdecafe, missed that one