title: Ocaml multi-line function in REPL
body: <p>I'm trying to write a multi-line function to use in an OCaml REPL. I've already seen <a href="https://stackoverflow.com/questions/52765234/write-a-multiline-function-in-ocaml">this question</a>, but the syntax suggested doesn't seem to work when using it in a REPL.</p>
  <p>To use a contrived example, I can't get the following to compile:</p>
  <pre><code>let theFun: int -&gt; int = fun x -&gt;
      let foo = x;
      foo;;
  </code></pre>
  <p>When I enter it without the &quot;;;&quot; in this <a href="https://try.ocamlpro.com/" rel="nofollow noreferrer">online REPL</a>, they get added in anyway and it gives me a syntax error. When I use a REPL on my local machine, the input won't get evaluated unless I include the &quot;;;&quot;, and that gives me a syntax error as well.</p>