These are chat archives for ramda/ramda

21st
Sep 2017
Darren
@dardub
Sep 21 2017 01:01
Ya boilerplate is a common complaint about redux. I think their argument in favor of boilerplate is that it makes things explicit.
I guess it's trade-offs. Boilerplate can introduce new bugs as well.
Any of you guys use a graphql client? I've been trying out apollo. But I'm not really a big fan of it. I don't like how it handles updates. Is there a less imperative approach?
mbanyar033
@mbanyar033
Sep 21 2017 11:55
Hello World My Learning ABC
arian‮
@arian-swydo
Sep 21 2017 12:08
hey guys, I'm looking at _arity.js, and a bit confused on what the usage is, and shouldn't it do a .call( ) instead since it's more optimized?
compose for instance simply passes the fn's argument length, why would it need to call _arity?
Kurt Milam
@kurtmilam
Sep 21 2017 12:11
@odyws-naira _arity is used to provide Ramda-style currying.
i.e.
const add3 = curry( ( x, y, z ) => x + y + z )
// now you can call add3 in the following ways:
add3( 1 )( 2 )( 3 )
add3( 1 )( 2, 3 )
add3( 1, 2 )( 3 )
add3( 1, 2, 3 )
// and let's not forget variations on this pattern:
add3()( 1 )()()( 2 )()()()( 3 ) // identical to add3( 1 )( 2 )( 3 )
// or the possibility to use the placeholder
add3( __, __, 3 )( __, 2 )( 1 ) // identical to add3( 1 )( 2 )( 3 )
arian‮
@arian-swydo
Sep 21 2017 12:17
thanks
Kurt Milam
@kurtmilam
Sep 21 2017 12:17
np
Konstantin Kostiuk
@SET001
Sep 21 2017 13:57
are tehre anything in ramda to check entities that present in both collections?
opposite to difference
Kurt Milam
@kurtmilam
Sep 21 2017 14:06
@SET001 intersection may be what you're looking for.
Konstantin Kostiuk
@SET001
Sep 21 2017 14:07
@kurtmilam thanx )
Kurt Milam
@kurtmilam
Sep 21 2017 14:07
np
Konstantin Kostiuk
@SET001
Sep 21 2017 14:07
I was going to implement it myself )
Denis Stoyanov
@xgrommx
Sep 21 2017 15:04
@SET001 :D
Konstantin Kostiuk
@SET001
Sep 21 2017 15:05
)
Vince Speelman
@VinSpee
Sep 21 2017 15:42
re: kurt - the reasons for breaking it out were two-fold:
  1. it's a common pattern in the library getPropsFor[x]Value
  2. I can test it in isolation
Kurt Milam
@kurtmilam
Sep 21 2017 15:44
@VinSpee If it's a common pattern, I'd leave it out :+1:
Vince Speelman
@VinSpee
Sep 21 2017 15:46
@kurtmilam thanks - I'm also going to look into refactoring it into sum types, I've hated the switch statement from day one but it got the job done
any suggested resource for implementation I can read?
Kurt Milam
@kurtmilam
Sep 21 2017 15:57
@VinSpee I think sum types might be overkill for this specific problem, but some libraries you might want to look at are static-sum-type, daggy and union-type (all on github and npm).
Vince Speelman
@VinSpee
Sep 21 2017 15:57
thanks - I'll investigate both options (simple lookup and sum-types) and learn something in the process :-)
Kurt Milam
@kurtmilam
Sep 21 2017 15:57
I'd probably go for a hashtable similar to @rolfst 's suggestion.
My sum type comment was aimed more at Brad Compton's compound if example.