title: Why is my Idris FFI function not printing the value in REPL?
body: <p>I'm trying to print the result of an <code>add</code> function implemented in C as per <a href="https://idris2.readthedocs.io/en/latest/ffi/ffi.html#ffi-example" rel="nofollow noreferrer">the docs</a>. I have</p>
  <pre><code>%foreign &quot;C:add,mylib&quot;
  add : Int -&gt; Int -&gt; Int
  </code></pre>
  <p>with</p>
  <pre class="lang-c prettyprint-override"><code>int add(int x, int y) {
      return x+y;
  }
  </code></pre>
  <p>but in the REPL I get</p>
  <pre class="lang-none prettyprint-override"><code>&gt; 1 + 2   
  3
  &gt; add 1 2
  add 1 2
  &gt; :exec printLn $ add 1 2
  3
  </code></pre>
  <p>Why is Idris treating my function differently to <code>(+)</code>? Indeed, if I just use</p>
  <pre><code>add : Int -&gt; Int -&gt; Int
  add = (+)
  </code></pre>
  <p>I get the same behaviour for <code>(+)</code> and <code>add</code>, from which I surmise it's sth to do with the FFI.</p>