Skip to content

Instantly share code, notes, and snippets.

@jhewlett
Last active December 18, 2018 19:44
Show Gist options
  • Save jhewlett/57d22f6895df64d9ccede1f8c7312d8e to your computer and use it in GitHub Desktop.
Save jhewlett/57d22f6895df64d9ccede1f8c7312d8e to your computer and use it in GitHub Desktop.
Combine results
let combineResults (results : Result<unit, NotAuthorized> seq) : Result<unit, NotAuthorized> =
results
|> Seq.tryFind (fun r ->
match r with
| Ok () -> true
| Error _ -> false)
|> Option.defaultValue (Error NotAuthorized)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment