And we have a function called getCustomerByEmail that retrieves a Customer by email address asynchronously from some external source -- a database, a web service, etc:
// string -> Task<Customer>letgetCustomerByEmail email :Task<Customer>=task{return{ Id =1; Email ="test@test.com"}// return a constant for simplicity}
If we have a value of type string option and want to call the getCustomerByEmail function, we can achieve it using the traverseTask function as below: