Expose better methods for chaining.
SimonRichardson opened this issue · 2 comments
SimonRichardson commented
Currently it's difficult to read some aspects of the code and it's not following the DRY principal - consider:
.chain(compose(M.modify)(constant))
.chain(constant(M.get))
.chain(compose(M.modify)(inject))
.chain(constant(M.get))
could be:
.modify(M, constant)
.get(M)
.modify(M, inject)
.get(M)
Even better would be to remove M
.
This is in response to @svoctor review.
SimonRichardson commented
The issue is making sure functions have one sole responsibility, because it could be done as, which warps all the chain up, alternatively you could use map?
.constantInject(M);
SimonRichardson commented