These are chat archives for ramda/ramda
prepend? Just flip it, right?
chainfunction name, what exactly are we chaining? Why not simply call it
R.forEachis the only function that supports side-effects
require('treis')(fn)and find it very useful for debugging
Error: Parser is unable to parse the response throwerrx.all.js:70 errorrx.all.js:10044 onErrorrx.all.js:1720 onErrorrx.all.js:1944 onErrorrx.all.js:10275 handlerrx.all.js:6425 callbackclient.js:841 (anonymous function)client.js:475 emitindex.js:133 onreadystatechangeclient.js:918
(Rx.config as any).longStackSupport = true;, but it doesn't seem to make any difference
x => xinstead of
identityare very different functions.
alwaysis more like
x => (y => x)or
x => (* => x).
() => 42instead of
x => xinstead of
R.identity. The question which is more obvious to the reader?
always. I guess
identitysimply doesn't do this add well for me. I was happier doing so when we had the alias of
I, and I could think about it as the combinator.
identityfeels as though it might have other meanings: return the identity property of the item.
identitysupposed to reflect identity in Category Theory?
@CrossEye, I'd like to understand why
R.filter(q, R.filter(p, x)) ≍ R.filter(p, R.filter(q, x))
demonstrates commutativity (rather than associativity). I spent some time reading Wikipedia and the FL spec in order to determine which is correct. I found it difficult to be sure since the concepts apply to binary operators.
Infix notation makes the situation a little clearer:
q `filter` (p `filter` x) ≍ p `filter` (q `filter` x)
The above shows that filtering x by p, then filtering the result by q is equivalent to filtering x by q, then filtering the result by p.
The following shows that adding 2 to 3, then adding 4 to the result is equivalent to adding 4 to 3, then adding 2 to the result:
(2 + 3) + 4 ≍ 2 + (3 + 4)
If commutativity means that changing the order of the operands of a binary operation does not change the result, wouldn't it require the following?
p `filter` x ≍ x `filter` p
What am I missing or misunderstanding?
R.filter(q, R.filter(p, x)) ≍ R.filter(p, R.filter(q, x))Thats associative
@davidchambers : Maybe I'm thinking about it wrong, but this is what I would think about as commutative:
f ∘ g = g ∘ f
So this is a demonstration of commutativity:
filter(f) ∘ filter(g) ≍ filter(g) ∘ filter(f)
This would take some work to demonstrate for a given implementation of filter.
But associativity would be the property that
filter(f)(filter(g)(filter(h))) ≍ (filter(f)(filter(g)))(filter(h))
You definitely cannot demonstrate associativity with only two entities.
filterwhether or not we know what to call it. :wink2: