Closed raulraja closed 6 months ago
Raise should definitely be added to the examples section.
Thank you @raulraja! 🙏
I took the liberty to alter your examples to fit the styleguide and avoid lines with too much width, but your examples are still there. I've also improved the KDoc for the bind
function, based on what you already did in the markdown.
This PR updates the Arrow integration documentation, focusing on demonstrating multiple bind operations. The aim is to show how Akkurate handles validations involving more than one operation.
The previous example with a single
bind
not consuming its result is usually considered an antipattern. In general, binding is only helpful inside aneither
block if there is more than one value to bind, and the second and further operations are somehow dependent on the results of previous operations.Here, we assume that for some reason, you should not attempt to validate an
author
unless you have previously validated abook
—still not the best example. The examples can be improved to show an actual use case of dependent monadic operations. Also, the examples may be expanded to includeRaise
vs. usingeither
blocks and the use of context-receivers.