January 2018
Beginner to intermediate
312 pages
7h 22m
English
We can now start implementing the validation step. The validation step will take the unvalidated order, with all its primitive fields, and transform it into a proper, fully validated domain object.
We modeled the function types for this step like this:
| | type CheckAddressExists = |
| | UnvalidatedAddress -> AsyncResult<CheckedAddress,AddressValidationError> |
| | |
| | type ValidateOrder = |
| | CheckProductCodeExists // dependency |
| | -> CheckAddressExists // AsyncResult dependency |
| | -> UnvalidatedOrder // input |
| | -> AsyncResult<ValidatedOrder,ValidationError list> // output |
As we said, we’re going to eliminate the effects for this chapter, so we can remove the AsyncResult parts, leaving us with this:
| | type CheckAddressExists ... |
Read now
Unlock full access