These are chat archives for ramda/ramda

Feb 2019
Feb 02 02:25
@ben-eb can you explain your example with Lens, I don't follow
  1. i don't think i fully understand the practicality - yet
Rakesh Pai
Feb 02 07:26
Anybody else feel like the signature of reducer functions is backwards? It would compose so much better if it took the array item first, and the accumulator second, in a curried form, right?
Feb 02 07:28
@JAForbes dang thanks. shouldnt have pushed that to production. why so difficult, R.min should be able to accept arrays by default imo
James Forbes
Feb 02 11:31
Binary operators are powerful for many reasons, it seems convoluted at first, but derivable behaviour is worth more than once off convenience for a single use case. Also I thought your post was super funny, and making mistakes in prod is inevitable we all do it, most releases in fact. 😀 @mokanfar
Also, I think the native Math.min is variadic, so your spread trick might have worked there.
Ben Briggs
Feb 02 12:56
@6ewis Lets say you have a graphql API that is using different identifiers for properties than your database, and so when you read from a database you would use L.get and when you would prepare an object to write to the database you would use L.getInverse - then your one lens is used to map between the formats. An alternative way is to write two mapping functions to convert your keys from/to - not that that is a bad way to do it, but I think this is where lenses are really powerful
Asad Saeeduddin
Feb 02 23:32
@ben-eb How does getInverse work?
does it only work if your focus is the entire structure?
Asad Saeeduddin
Feb 02 23:39
Yeah, thanks
so it works on isomorphisms
Ben Briggs
Feb 02 23:39
Yes. It's basically a set on undefined
Ben Briggs
Feb 02 23:48
Anyway of course you might have some data coming in from several sources and so having a lens in between to map the data format is definitely worth looking into
Asad Saeeduddin
Feb 02 23:51
@rakeshpai reduceRight works that way I believe
although it looks like it doesn't accept a curried redex
Feb 02 23:53
Hello again everyone. When should one favor Ramda's T and F over plain true and false booleans?