I think it would be clearer if you bound the record and put ` snd (List.fold_right node v (0, init_state))` on a single line.