Skip to content

Instantly share code, notes, and snippets.

@Neftedollar
Created February 13, 2019 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neftedollar/def3cd869719926fdeb49af69ef544fd to your computer and use it in GitHub Desktop.
Save Neftedollar/def3cd869719926fdeb49af69ef544fd to your computer and use it in GitHub Desktop.
/// Call all specified tasks sequentially one after the other and combine the results together.
let seq (tasks: OrchestratorBuilder.ContextTask<'a> list) =
let rec work acc (rem : OrchestratorBuilder.ContextTask<'a> list) =
match rem with
| [] -> fun _ -> Task.FromResult (acc |> List.rev)
| d :: rest -> orchestrator {
let! t = d
return! work (t::acc) rest
}
work [] tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment