Closed mwhipple closed 8 years ago
This would also free composition to handle other things like pre-validation transformation for which a recipe could be provided.
The equivalent approach in the DSL layer could be to accept an array so the summed Checks could be a comma separated sequence
The initial implementation uses Groovy style
<<
and>>
to allow composing aCheck
that calls the delegate checks (without any short circuiting). This was an attempt to borrow the existing convention but doesn't match the contract of closure/function composition.(f >> g)(x)
should be the equivalent off(g(x))
but rather than call one Check on the return of the other Check (the ResultMap) Valerie adds the returned ResultMaps together equivalent tof(x) + g(x)
so it should be more consistent to useplus/+
for combining the Checks and disabling composition.This should have minimal impact on deployed client code since this is a relatively low level detail in most uses.