Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let findOk result item =
result
|> successTee (fun (obj, msgs) ->
let found = msgs |> List.toSeq |> Seq.tryFind (fun(m) -> m = item)
match found with
| Some msg -> msg |> should be (sameAs item)
| None -> failwith(sprintf "%s not found" item)
)
let findFailure result item =
result
|> failureTee (fun (msgs) ->
let found = msgs |> List.toSeq |> Seq.tryFind (fun(m) -> m = item)
match found with
| Some msg -> msg |> should be (sameAs item)
| None -> failwith(sprintf "%s not found" item)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.