Closed LarryBattle closed 9 years ago
You're right, it's the comment in the post that is wrong. It should have been compose(x, y, z)
and not compose(x(), y(), z())
. I fixed the post.
compose
will return a function that, when passed a value, will call the functions right-to-left. But note that these transducers return a function that take a transformer, so while they are calling right-to-left, they just build up a final chain of transformers, and then they are executed left-to-right. So all transducers are executed left-to-right, in the order they are defined.
From this post it states this.
compose(x(), y(), z())(val) into x(y(z(val)))
However when I test this, the functions are called in reverse order. Here's a test.compose-test.js
output
Shouldn't the test pass?