These are chat archives for ramda/ramda

Feb 2017
Galileo Sanchez
Feb 25 2017 06:09
Are the set of unary functions under composition, a monoid?
You have the identity function as the identity element of the set
And composition is associative
F°G °H == (F°G)°H == F°(G°H)
Can we write an Middleware using algebraic structures?
Markus Pfundstein
Feb 25 2017 07:47
check Compose from @xgrommx (I think its a Monad and a Monoid)
Jernej Sila
Feb 25 2017 12:50
Hi guys, this might sound silly but does there currently exist a way in Ramda that when using evolve you can specify a transformation for a property that actually removes this property? Thus saving me an extra step of filtering that property out.
Stefano Vozza
Feb 25 2017 13:01
It's a bit hacky but could you use always(void 0). It's pretty horrible though.
Galileo Sanchez
Feb 25 2017 14:25
@JSila if you don't have that many properties you can use applySpec
Jernej Sila
Feb 25 2017 14:34
always(void 0) still returns property, its value is undefined. applySpec is interesting but number of properties varies (it's array-like object - made manually, not some dom elements collection etc). thanks for suggestions though.
Galileo Sanchez
Feb 25 2017 15:16
you can use exclude/omit on your object after evolving it
compose(evolve(spec), omit(['notThis','notThat']))
or before, depending on your use case
Denis Stoyanov
Feb 25 2017 17:55
What do u think?
Keith Alexander
Feb 25 2017 18:18
@xgrommx I think "how do you compose functions that expect named arguments?"
I think it creates a bigger problem than it solves. What do you think @xgrommx ?
Rick Medina
Feb 25 2017 19:04
100% agree. Also, I don't like this kind of phrasing Phew, that's a lot of argument juggling! FPO eliminates all that noisy distraction. specially when you are comparing to the exception rather than the rule, and really, a non existent one: var f = x => R.reduce(x, 0, [3,7,9])
Brad Compton (he/him)
Feb 25 2017 20:29
One minor thing is that positional parameters provide better IDE support than named parameters, at least in my experience. Destructuring is nice, but you have to actually look at the function definition to see what parameters need to be passed in to the function, whereas (in my IDE at least) typing out the function will automatically tell me what arguments should be passed in to it.
Brad Compton (he/him)
Feb 25 2017 20:39
I really like that people are trying out a variety of styles to writing FP in javascript. It's really cool that all these things are being tried out, and this will probably be helpful for some people that don't like the other options out there.
Keith Alexander
Feb 25 2017 21:57
Maybe it works if you do composition pointedly with Coyoneda or something
I think you'd end up with more boiler plate though.