Skip to content

Instantly share code, notes, and snippets.

@rgrinberg
Created July 11, 2016 18:00
Show Gist options
  • Save rgrinberg/3451fa6818d1f245f0bb3541132327d3 to your computer and use it in GitHub Desktop.
Save rgrinberg/3451fa6818d1f245f0bb3541132327d3 to your computer and use it in GitHub Desktop.
(* in reality you should wrap this function inside a parent function
that makes sure that an empty list wasn't passed. *)
let rec prepare_all dbh ~f = function
| [] -> f ()
| query::qs ->
with_prepare dbh ~query ~f:(fun () -> prepare_all dbh ~f qs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment