January 2018
Beginner to intermediate
312 pages
7h 22m
English
In the modeling chapters, we defined special function types to represent each step of the workflow. Now that it’s time for implementation, how can we ensure that our code conforms to them?
The simplest approach is just to define a function in the normal way and trust that when we use it later, we’ll get a type-checking error if we get it wrong. For example, we could define the validateOrder function as below, with no reference to the ValidateOrder type that we designed earlier:
| | let validateOrder |
| | checkProductCodeExists // dependency |
| | checkAddressExists // dependency |
| | unvalidatedOrder = // input |
| | ... |
This is the standard approach for most F# code, but if we want to make it clear that ...
Read now
Unlock full access