SimonRichardson/defender

Expose better methods for chaining.

SimonRichardson opened this issue · 2 comments

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.

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);

This is now done @svoctor, still #3 needs doing, but I'll do that tomorrow.