OCaml is not a purely functional programming language. It allows the use of imperative programming, like arrays with in-place modification. It also features an object-oriented style.
This shows how practical the OCaml programming language is. Many problems and tasks have no easy answers in a purely functional programming style. The most obvious example is writing a file. This operation requires you to adopt an imperative programming style, because you end up modifying the state of your computer. Variants using purely functional exist, like the I/O Monad, but even if they allow you to bridge the gap between an imperative scheme and a purely functional style, this is not as efficient as direct access to the filesystem.
With OCaml, you can use the best paradigm to solve your problem.