title: Partial application of Printf.ksprintf
body: <p>I'm trying to write a version of <code>Printf.printf</code> that always appends a newline character after writing its formatted output.  My first attempt was</p>
  <pre class="lang-ml prettyprint-override"><code># let say fmt = Printf.ksprintf print_endline fmt;;
  val say : ('a, unit, string, unit) format4 -&gt; 'a = &lt;fun&gt;
  </code></pre>
  <p>The type signature looks right and <code>say</code> works as expected. I noticed that <code>fmt</code> is listed twice, and thought that partial application could eliminate it.  So I tried this instead:</p>
  <pre class="lang-ml prettyprint-override"><code># let say = Printf.ksprintf print_endline;;
  val say : ('_weak1, unit, string, unit) format4 -&gt; '_weak1 = &lt;fun&gt;
  </code></pre>
  <p>The function definition looks cleaner, but the type signature looks wrong and <code>say</code> no longer works as expected.  For example, <code>say</code> doesn't type check if the format string needs a variable number of arguments: I get an error that <code>say</code> &quot;is applied to too many arguments&quot;.</p>
  <p>I can use the <code>let say fmt = …</code> implementation, but why doesn't partial application work?</p>