either
JobOption.either
('a -> Job<'b>) -> Job<'b> -> Job<'a option> -> Job<'b>Examples
Example 1
let tryFindUser : string -> Job<User option>
// Job<string>
tryFindUser "alice"
|> JobOption.either
(fun user -> Job.singleton (sprintf "Found user: %s" user.Name))
(Job.singleton "User not found")Example 2
let maybeValue : Job<int option> = Job.singleton (Some 42)
maybeValue
|> JobOption.either
(fun x -> Job.singleton (x * 2))
(Job.singleton 0)
// job { return 84 }Example 3
Last updated