traverseTaskResult
Last updated
Last updated
Namespace: FsToolkit.ErrorHandling
Function Signature:
Note that traverse
is the same as map >> sequence
. See also .
See also Scott Wlaschin's .
Say we have a function to get a number from a database (asynchronously), and multiply our input by that number if it's found:
If we start with an optional value, then we could map this function using Option.traverseTaskResult
as follows:
If we combine this with the , we could directly let!
the output: