title: Write a multiline function in ocaml
body: <p>I'm having trouble understanding how to write functions in ocaml as I've only written recursive functions that don't require multiple lines separated by a <code>;</code>.</p>
  
  <p>I'm trying to create a function that given a int number n returns a matrix full of zeroes and just ones in the diagonal, so an identity matrix of size n.<br>
  I'm new to functional programming and ocaml so  I was wodering if it was possible to write this in a imperative way.
  For example in Java I'd write:</p>
  
  <pre><code>public int[][] identity(int size) {
      int[][] matrix;
      matrix = new int[size][size];
      //fill the matrix with zeroes
      for( int i=0; i&lt;size; i++){
          for( int j=0; j&lt;size; j++){
              matrix[i][j] = 0;
          }
      }
      //diagonal values at 1
      for (int i=0; i&lt;size; i++){
          matrix[i][i] = 1;
      }
      return matrix;
  }
  </code></pre>
  
  <p>How can I achieve this in ocaml?</p>