let
cardinal s =
fold_range ~f:(
fun
n1 n2 c
->
c + n2 - n1 + 1) s ~init:0