How do you cast an ocaml boolean to an integer? (There's no int_of_bool function.)
int_of_bool
Here's one possible implementation:
let int_of_bool b = if b then 1 else 0
The library OCaml Batteries Included has a function to_int in its BatBool module.
to_int