January 2018
Beginner to intermediate
312 pages
7h 22m
English
We understand the concepts now, so let’s put them into practice. We’ll compose the workflow pipeline using our error-generating functions, tweaking them as necessary so that they fit together.
Let’s quickly revisit the components of our pipeline, focusing on Result and ignoring the Async effect and the service dependencies for now.
First, ValidateOrder will return an error if the input data is not in the right format, so it’s a “switch” function and its signature will be like this:
| | type ValidateOrder = |
| | // ignoring additional dependencies for now |
| | UnvalidatedOrder // input |
| | -> Result<ValidatedOrder, ValidationError> // output |
The PriceOrder step may also fail for a variety of reasons, so its signature ...
Read now
Unlock full access