I'm honestly still having a hard time wrapping my brain when it comes to this. I mean, it's easy to understand normal compose and pipe flow of data. But, it's challenging for me to 100% track the flow of reducers in the transducers.
Thanks for the example. Took me a lot of reread :)
Ya, it's hard stuff. If we dig even deeper the reason for all this confusing behavior is the composition itself. comp doesn't return a value, but another composed function. I think you already mentioned this in your post. This is sometimes called abstraction over arity, because this new composed function expects more arguments than comp = (f, g) => x => f(g(x)) has originally required. Whenever this happens, the order of evaluation switches to left-to-right, not only with transducers.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm honestly still having a hard time wrapping my brain when it comes to this. I mean, it's easy to understand normal compose and pipe flow of data. But, it's challenging for me to 100% track the flow of reducers in the transducers.
Thanks for the example. Took me a lot of reread :)
Ya, it's hard stuff. If we dig even deeper the reason for all this confusing behavior is the composition itself.
comp
doesn't return a value, but another composed function. I think you already mentioned this in your post. This is sometimes called abstraction over arity, because this new composed function expects more arguments thancomp = (f, g) => x => f(g(x))
has originally required. Whenever this happens, the order of evaluation switches to left-to-right, not only with transducers.